html:
<nav mat-tab-nav-bar color="primary" [tabPanel]="tabPanel" mat-stretch-tabs="false" mat-align-tabs="start">
<a mat-tab-link *ngFor="let link of navLinks" [routerLink]="link.route" routerLinkActive #rla="routerLinkActive" [active]="rla.isActive">{{ link.label | translate }}</a>
</nav>
ts file :
public navLinks: { label: string, route: string }[] = this.activatedRoute.snapshot.data['tabs'];
Approach 1
use
[disabled]="true"
attribute in htmlApproach 2
Specify the function which triggers in on click event like
(click)="onTabClick(routerLink1)
and then in component.ts follow it up withtabLink.preventDefault();
In html :
In your component.ts :