【发布时间】:2017-05-30 11:04:30
【问题描述】:
现在,我的网站 url 看起来像这样,因为我使用的是 here 描述的方法
http://localhost:4200/#/cadastro
是否可以删除url中的hash而不出现404错误?
编辑:添加了路由器模块
const appRoutes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'cadastro', component: CadastroNoivosComponent },
{ path: '**', component: HomeComponent }
];
export const routing = RouterModule.forRoot(appRoutes);
【问题讨论】:
标签: html angular angular2-routing