Components: Can't bind to 'active' since it isn't a known property of 'a'

Created on 16 May 2018  路  10Comments  路  Source: angular/components

Bug, feature request, or proposal:

I'm using the mat-tab-link inside a mat-tab-nav-bar and I'm getting the error:

Error: Template parse errors:
Can't bind to 'active' since it isn't a known property of 'a'. ("gFor="let link of navLinks" [routerLink]="['/'+link.path]" routerLinkActive #rla="routerLinkActive" [ERROR ->][active]="rla.isActive">
      {{link.label}}
    </a>

What is the expected behavior?

Not getting the error

What is the current behavior?

Getting the error

What are the steps to reproduce?

<nav mat-tab-nav-bar>
    <a matTabLink *ngFor="let link of navLinks" [routerLink]="['/'+link.path]" routerLinkActive #rla="routerLinkActive" [active]="rla.isActive">
      {{link.label}}
    </a>
  </nav>

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6.0.2, Material 6.0.2, Safari and Chrome, Typescript 2.7.2.

Most helpful comment

Can you double-check that you've included the MatTabsModule in your app?

All 10 comments

Can you double-check that you've included the MatTabsModule in your app?

I had the same problem, it was indeed missing the MatTabsModule.

Hmm, I'm having this same problem now, even with the MatTabsModule...

Having this issue even though i have included MatTabsModule with trying to use tabs with active link to do navs. but normal tabs work fine.

same issue here

I added the MatTabsModule but still fails. What's the solution for this?

ERROR in : There is no directive with "exportAs" set to "routerLinkActive" ("-link *ngFor="let link of links"
[routerLink]="link.path"
routerLinkActive [ERROR ->]#rla="routerLinkActive"
[active]="rla.isActive">
{{ link.data.title }}
")
: Can't bind to 'routerLink' since it isn't a known property of 'a'. ("tab-nav-bar live-detail-view-nav>
[ERROR ->][routerLink]="link.path"
routerLinkActive #rla="routerLinkActive"
[active]="r")

I am also facing the same problem. I have included MattabModule.

Hmm, I'm having this same problem now, even with the MatTabsModule...

need import MatTabsModule in app.module

imports: [MatTabsModule]

this reply for another users

This is still hapenning, i have MatTabsModule in the current module and app.module

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RoxKilly picture RoxKilly  路  3Comments

alanpurple picture alanpurple  路  3Comments

dzrust picture dzrust  路  3Comments

kara picture kara  路  3Comments

jelbourn picture jelbourn  路  3Comments