Angular2 router - Navigate to the current page with different parameters

前端 未结 4 1973
梦毁少年i
梦毁少年i 2020-12-30 23:56

I am trying to route to the current page with different param with no avail. I have a combo box that triggers:

this.router.navigate([\'page\', selectedId]);
         


        
4条回答
  •  自闭症患者
    2020-12-31 00:56

    The simplest way I found, by subscribing the router and then reload the page:

    this.router.navigate(['page', selectedId]).then(page => { window.location.reload(); });
    

提交回复
热议问题