首页 > 解决方案 > 我想从我的 url 中删除 pages/ 角度 5

问题描述

我有 { path: 'pages/:id', component: PagesComponent }, 这就是为什么我的网址看起来像

http://localhost:4200/pages/aboutus

因此,出于 SEO 的目的,我想从 URL 中删除该页面以显示 URL,例如

http://localhost:4200/aboutus

标签: angular

解决方案


首先,与“aboutus”相关的组件是什么(如果有的话)。我还建议您记录该指南,它的结构非常好。

https://angular.io/guide/router


推荐阅读