是否可以在角度2和4中顯示特定路由的地址欄中的狀態名稱。例如,我有以下路由配置,Angular 2 - 路由 - 在瀏覽器地址欄中顯示不同的路由名稱
{
path:"animals",
component : AnimalComponent,
children:[{
path:"cat",
component:CatComponent
},{
path:"dog",
component:DogComponent
}]
}
當地址是「animals/cat」時,它在AnimalComponent router-outlet中加載CatComponent,當地址是「animals/dog」時,它加載AnimalComponent router-outlet中的DogComponent。是否可以在地址欄中爲「動物/狗」路線的「動物/貓」和「狗」在地址欄中僅顯示「貓」。
聽起來你正在尋找對於像https://stackoverflow.com/questions/38644314/changing-the-page-title-using-the-angular-2-new-router/38652281?s=1|3.2069#38652281或只是設置標題'與其他一些數據。 –
請參閱:[設置文檔標題](https://angular.io/guide/set-document-title) – pzaenger