I am trying to get routerLink Parameter using ActivatedRoute.
constructor(private route: ActivatedRoute) { }
ngOnInit() {
this.pageTitle = this.route.snapshot.params['title'];
}
It shows the parameter first time only. But not again when the parameter is changed.
Link to StackBlitz example.
When I click Search Page a it shows title is test. But when I click on Search Page b it still keeps on showing title is test even though the title is testing. However when I click Home and then Search Page b it shows the updated parameter as testing.
How do I fix the issue so that when click Search Page b after Search Page a it shows me the updated parameter.