修改Angular路由模式为hash模式

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……
共有 0 条评论