Angular 2 reload route on param change

后端 未结 13 1110
小鲜肉
小鲜肉 2020-12-07 13:15

I am currently writing my first Angular 2 Application. I have an OverviewComponent which has the following simple template:

13条回答
  •  粉色の甜心
    2020-12-07 13:48

    I solved it by using event, if the child component send a new link, and emit an event, then the parent can find the change and call to some reload function, which will reload the necessary data. Another option is to subscribe to the route parameters, and found when it change But I do think that the guys from angular2 should think about adding parameters to the router.navigate function, which can force the reload. (forceReload=true)

提交回复
热议问题