The page will not refresh, cause that's how the Router
works.. without refreshing the page!
You have to subscribe to the route parameters to detect changes in them and then do whatever you want to with that information..
So inject ActivatedRoute
into your component and subscribe to the parameters like this:
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.route.params.subscribe(params => {
// PARAMS CHANGED .. TO SOMETHING REALLY COOL HERE ..
// for example extract the id..
let id = +params['id']; // (+) converts string 'id' to a number
});
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…