修改Angular路由模式为hash模式

spa 应用一般有html5 history模式和hash模式,angular 默认是 history 模式,修改为hash 的方法:

import {HashLocationStrategy, LocationStrategy} from '@angular/common';
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}],

重新运行项目即可

上一篇 angular 实现皮肤主题切换的解决方案
下一篇 css3背景颜色渐变动画