我需要修改当前路线的数据对象中的面包屑值。这是我的路线配置。
{
path: "users",
component: UserListComponent,
children: [
{
path: ":id",
component: UserComponent,
data: {
breadcrumb: '<User name here>'
},
}
],
data: {
breadcrumb: 'Users'
}
},
Run Code Online (Sandbox Code Playgroud)
我正在尝试这样做:
this._route.data = { breadcrumb: this.user.displayName }; //_route is ActivatedRoute
Run Code Online (Sandbox Code Playgroud)
但它不起作用。任何帮助,将不胜感激。谢谢。