Angular 2: 404 error occur when I refresh through the browser [duplicate]

https://stackoverflow.com/questions/35284988/angular-2-404-error-occur-when-i-refresh-through-the-browser

#前端#

修改app.module.ts

import { HashLocationStrategy, LocationStrategy } from '@angular/common';

providers: [
  { provide: LocationStrategy, useClass: HashLocationStrategy }
],

修改root-routing.module.ts

imports: [RouterModule.forRoot(routes, { useHash: true })],

猜你喜欢

转载自www.cnblogs.com/lishidefengchen/p/10594606.html