我正在尝试使用 router.navigate 在 Angular 2 中重新加载相同的 url,但它不起作用。 网址:http://localhost:3000/landing 场景:我在 http://localhost:3000/landing现在我正在更改页面中的一个特定参数,它应该重新加载页面。
代码:
let link = ['Landing'];
this.router.navigate(link);
最佳答案
导航到某个虚拟组件,然后导航到您要重新加载的组件。 //第二个参数_skipLocationChange=true 避免后退按钮中出现该url
this.router.navigateByUrl('/DummyComponent', true);
this.router.navigate(["Landing"]);
关于angular - 如何在 Angular 2 中重新加载相同 URL 的组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39396075/