相关疑难解决方法(0)

Angular2在网址中没有哈希值

现在,我的网站的网址看起来像这样,因为我正在使用此处描述的方法

HTTP://本地主机:4200 /#/ cadastro

是否可以删除网址中的哈希值而不会出现404错误?

编辑:路由器模块添加

const appRoutes: Routes = [
    { path: '', component: HomeComponent },
    { path: 'cadastro', component: CadastroNoivosComponent },
    { path: '**', component: HomeComponent }
];

export const routing = RouterModule.forRoot(appRoutes);
Run Code Online (Sandbox Code Playgroud)

html5 angular2-routing angular

9
推荐指数
2
解决办法
2万
查看次数

标签 统计

angular ×1

angular2-routing ×1

html5 ×1