1、index.html调整
<base href="/" rel="external nofollow">
2、app-routing.module.ts调整
在@NgModule里面引用app路由时,直接引用RouterModule.forRoot(appRoutes);
如果想连同链接里的app一起去掉的话,在app路由命名时,链接到main的路由path命名为空;
app-routing.module.ts调整如下图:

1、index.html调整
<base href="/" rel="external nofollow">
2、app-routing.module.ts调整
在@NgModule里面引用app路由时,直接引用RouterModule.forRoot(appRoutes);
如果想连同链接里的app一起去掉的话,在app路由命名时,链接到main的路由path命名为空;
app-routing.module.ts调整如下图:
本文标题:Angular4 去除链接中的#
本文链接:https://www.haomeiwen.com/subject/ymmbmftx.html
网友评论