Good morning, everyone. I tell you my problem.
I had to modify my HTML to remove the routerLink=""
and now do that logic in the controller with router.navigate[()]
So the html is something like this:
<ul class="nav">
<li routerLinkActive="active" (click)="changeUrl('0')">
<a>
<span>{{menu[0].title}}</span>
</a>
</li>
<li routerLinkActive="active" (click)="changeUrl('1')">
<a>
<span>{{menu[1].title}}</span>
</a>
</li>
And in the component.ts you simply control in the method changeUrl(orden: number)
that shows the user a confirmation message before doing the
router.navigate[()]
to redirect you if you accept.
The problem is that with these changes the routerLink="active"
has stopped working.
Does anyone know how I can solve it?