Skip to content

Commit

Permalink
fix: use RouterLinkActive to fix active link logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmcquade committed Dec 24, 2024
1 parent 9f195f6 commit 739cff7
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
routerLinkActive="active-link"
[routerLink]="'template/' + button.target_template"
[attr.data-name]="button.name"
(click)="toggleIcon()"
[ngClass]="isActive ? 'active-link' : ''"
#rla="routerLinkActive"
>
<div *ngIf="!isActive" class="icon">
<img [src]="button.icon | plhAsset" />
</div>
<div *ngIf="isActive" class="icon">
<img [src]="button.active_icon | plhAsset" />
<div class="icon">
<img [src]="(rla.isActive ? button.active_icon : button.icon) | plhAsset" />
</div>
<div class="label">
<p>{{ button.label }}</p>
Expand Down

0 comments on commit 739cff7

Please sign in to comment.