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 })],

 

posted @ 2019-03-25 16:39  lishidefengchen  阅读(260)  评论(0编辑  收藏  举报