0
我正在使用Angular4。我有一些显示在app.component模板中的BarComponent(几乎所有页面,就像菜单栏)。我想获得“属于”另一个组件的路由器参数,而不是BarComponent的子/孩子。
例如,我的路线:
从Angular中的另一个组件获取路由器参数
/some-section-name/:id{here may be sub-routes}
我能得到这样的:使用BarComponent内的角方法ID PARAM?
结构是这样的:
|- app.component
|- bar.component
|- (lazy load) some section
|- here is the component that has this :id param
有趣的选择,很好,它不关心嵌套级别。糟糕的时刻 - 递归,如果应用程序有很多孩子。但是,无论如何,这很有帮助。 – WeekendMan