作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Angular 路由(在我的 app-routing.module.ts 中)
@NgModule({
exports: [ RouterModule ],
imports: [ RouterModule.forRoot(routes) ],
declarations: []
})
在 index.html 中我添加了 <base href="/">
但在 URL 中我可以看到 #
我的应用程序部署在 JBoss AS 7.1.1 服务器上
最佳答案
在您的应用模块中执行此操作。在 here 中查找更多信息关于哈希定位策略。
@NgModule({
imports: [
// other imports
RouterModule.forRoot(routes, { useHash: false })
],
declarations: [
],
providers: [
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
关于angular - 如何从 Angular 5 中的 URL 中删除散列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49892407/
我是一名优秀的程序员,十分优秀!