【发布时间】:2017-07-17 10:08:14
【问题描述】:
是否可以在地址栏中以角度 2 和 4 显示特定路线的状态名称。例如,我有以下路线配置,
{
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。是否可以在“animals/cat”的地址栏中只显示“cat”,在“animals/dog”路由的地址栏中只显示“dog”。
【问题讨论】:
-
听起来您正在寻找类似stackoverflow.com/questions/38644314/… 的东西,或者只是将
title设置为一些其他数据。