Alright I've got this put together in stackBlitz so fork the project and let me know if you find a way to fix this. I've got a nav component that has child components that are the home page(landing) and a film component for each specific film you can link to. You can route to these from the films section of the navbar, or by clicking on one of the films in the landing page. I'm stuck right now because after I click on one of the links, I must navigate back to the home page before I can click on another. I cannot use the nav link to navigate to another /film/:name when I've navigated to one already, and that's just bad. I wanna learn how to fix this, do you guys have any advice?
Here's some changes I added to my local project:
pr`enter code here`ivate sub: Subscription;
ngOnInit() {
this.film = this.route.snapshot.paramMap.get('name');
this.sub = this.route.params.subscribe((_) => this.ngOnInit());
}
ngOnDestroy() {
this.sub.unsubscribe;
}
I'm now getting a callstack runtime error, it goes through 1000 iterations before finally loading to the next page
link to my code: https://stackblitz.com/edit/angular-ivy-fyqmhc
points of interest (*ngFor nav links, landing links) and check out the approuting module to see the flow of code