Router Navigate does not call ngOnInit when same page

前端 未结 12 1065
时光取名叫无心
时光取名叫无心 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:48

    When you want to router navigate on the same page and want to call ngOnInit(), so you do like that e.g,

    this.router.navigate(['category/list', category]) .then(() => window.location.reload());

提交回复
热议问题