index.html
<base href="/">
app.module.ts
import { LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
providers: [
// { provide: LocationStrategy, useClass: HashLocationStrategy } // hash模式
{provide: LocationStrategy, useClass: PathLocationStrategy} // 无#及h5 history模式
],
hash模式: http://localhost:4200/school
h5模式: http://localhost:4200/#/school