我使用@角/路由器角路由器选购PARAMS破坏/初始化组件
我的路线:
{
path: '',
component: MyComponent,
},
{
path: ':id',
component: MyComponent
}
}
有任何选项,两个状态(“”,“之间导航:ID “)而不destory /初始化MyComponent
例如:
网址:空, 呼叫ngOnInit()
网址:/some_id
, 通话ngOnDestory()
,ngOnInit()
(破坏/建设为MyComponent)
肯定。你想要做什么'无参数'和'id = 1'一些价值应该如何表现。我的建议是使用两个不同的组件。 – Aravind
我需要两个选项相同的组件... – YairTawil