Reputation: 794
I am using mat-chips from material.angular.io
<mat-chip-list class="categories">
<mat-chip><a href="/publication/category/{{category.id}}">
{{category.name}}</a></mat-chip>
</mat-chip-list>
If I click with the center button of the mouse the link works and opens another tab, but I can not open the link with left click.
I tried with class="link-overlapping", but still does not working.
Upvotes: 1
Views: 6175
Reputation: 386
I suggest this way
<mat-chip><a routerLink="/test" class="mat-standard-chip" style="margin:0; padding:0;">My link</a></mat-chip>
So that link is displayed at the bottom left of the screen when mouse is hovering.
Upvotes: 0
Reputation: 18288
You don't need the anchor at all you can just use routerLink
directly on mat-chip
:
<mat-chip-list class="categories">
<mat-chip [routerLink]="['publication/category', category.id]">
{{category.name}}
</mat-chip>
</mat-chip-list>
Upvotes: 6
Reputation: 1030
Did you try with routerLink? it works for me.
<mat-chip-list class="categories">
<mat-chip><a [routerLink]="['/your_path']">{{ data }} </a></mat-chip>
</mat-chip-list>
</div>
Upvotes: 1