Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't bind to 'active' since it isn't a known property of 'mat-tab'

Tags:

angular

I'm having this error even if I imported MatTabsModule.

here's how my component looks like:

@Component({
selector: 'app-settings-page',
template: `
<mat-tab-group animationDuration="0ms">
  <mat-tab
    *ngFor="let routeLink of routeLinks; let i = index;"
    [label]="routeLink.label"
    [routerLink]="routeLink.link"
    [active]="activeLinkIndex === i">
  </mat-tab>
</mat-tab-group>
<router-outlet></router-outlet>`
})
like image 783
Cold Cerberus Avatar asked Oct 19 '25 01:10

Cold Cerberus


1 Answers

As i see the problem here is using <mat-tab-group>, remove that part and it should work fine.

  <mat-tab
    *ngFor="let routeLink of routeLinks; let i = index;"
    [label]="routeLink.label"
    [routerLink]="routeLink.link"
    [active]="activeLinkIndex === i">
  </mat-tab>
like image 66
Sajeetharan Avatar answered Oct 22 '25 04:10

Sajeetharan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!