I have already reviewed a similar question titled router.navigate changes the URL, but is not rendering the component but encountered the same issue in my scenario.
Within my routes module, I have a route defined as follows:
{
path: "competition/details",
loadChildren: "../pages/competitions/competitions-details/competitions-details.module#CompetitionsDetailsModule"
}
The "competition-details" page renders the element:
<standings-regular></standings-regular>
In the component, I extract 2 optional parameters:
this.competitionId = this.activatedRoute.snapshot.params.competition;
this.condition = this.activatedRoute.snapshot.params.condition;
Using these parameters, I construct an array to display different views of the same table based on the URL provided directly in the browser:
For example:
http://localhost:4200/competition/details;competition=219;condition=home
These URLs represent various views of the same table for a specific competition.
http://localhost:4200/competition/details;competition=219;condition=home
will show the standings table with only home matches for each team in competition 219.
http://localhost:4200/competition/details;competition=219
will display the table with all matches from competition 219.
Now, I want to include a link within the table to navigate to a new URL. However, when attempting to do so, the URL changes in the browser but the view remains the same.
My navigation attempt is shown below:
<ul class="dropdown-menu btn-primary dropdown-menu-right">
<li>
<a md-ripple [routerLink]="['/competition/details', {competition: '219'}]">Complete</a>
</li>
<li>
<a md-ripple [routerLink]="['/competition/details', {competition: '219', condition: 'home'}]">Home Only</a>
</li>
</ul>
I have attempted using both router.navigate() and router.navigateByUrl() to no avail.
Any insights on how to resolve this issue?