Router Navigate does not call ngOnInit when same page

前端 未结 12 1050
时光取名叫无心
时光取名叫无心 2020-11-28 03:20

I am calling router.navigate on same page with some query string parameters. In this case, ngOnInit() does not call. Is it by default or do I need

12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 03:40

    NgOnInit would be called once when an instance is created. For the same instance NgOnInit won't be called again. In order to call it it is necessary to destroy the created instance.

提交回复
热议问题