spa 应用一般有html5 history模式和hash模式,angular 默认是 history 模式,修改为hash 的方法:
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}],
重新运行项目即可
spa 应用一般有html5 history模式和hash模式,angular 默认是 history 模式,修改为hash 的方法:
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}],
重新运行项目即可