📜  使用 Angular 中的父级获取子路由 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:35.945000             🧑  作者: Mango

代码示例1
constructor(private _route: ActivatedRoute, private _router: Router)

this._router.events
.filter(event => event instanceof NavigationEnd)
 .subscribe(
    () => {
       console.log(this._route.snapshot.firstChild.data);
    }
);