修改Angular路由模式为hash模式

chat
chat

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

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

重新运行项目即可

THE END
分享
二维码
海报
修改Angular路由模式为hash模式
spa 应用一般有html5 history模式和hash模式,angular 默认是 history 模式,修改为hash 的方法: import {HashLocationStrategy, LocationStrategy} from '@a……
<<上一篇
下一篇>>
chat