this.router.events
.pipe(
filter(event => event instanceof NavigationEnd),
map(() => this.activatedRoute),
map(route => {
while (route.firstChild) route = route.firstChild;
return route;
}),
filter(route => route.outlet === 'primary'),
mergeMap(route => route.data)
)
.subscribe((event) => {
// 更改页面title
if(event["breadcrumb"]){
this.toolbarNavMenuName = event["breadcrumb"];
console.log( this.toolbarNavMenuName);
//hide navside
$('.navToggle').click();
sessionStorage.setItem("toolbarNavMenuName", this.toolbarNavMenuName);
}
});
this.activatedRoute
.queryParams
.subscribe(params => {
// Defaults to 0 if no query param provided.
this.query = +params['pk'] || 0;
});