components icon indicating copy to clipboard operation
components copied to clipboard

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

Open AnasSahel opened this issue 8 years ago • 10 comments

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.

AnasSahel avatar May 16 '18 20:05 AnasSahel

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

crisbeto avatar May 16 '18 20:05 crisbeto

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

AsantosCandor avatar May 24 '18 11:05 AsantosCandor

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

papiro avatar Aug 31 '18 00:08 papiro

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.

ghost avatar Sep 04 '18 07:09 ghost

same issue here

budpok56 avatar Oct 03 '18 19:10 budpok56

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> <a mat-tab-link *ngFor="let link of links" [ERROR ->][routerLink]="link.path" routerLinkActive #rla="routerLinkActive" [active]="r")

aparna999 avatar Feb 27 '19 23:02 aparna999

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

senthilpsg avatar May 13 '19 06:05 senthilpsg

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

zbralex avatar Jun 09 '19 15:06 zbralex

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

matheusdavidson avatar Aug 04 '19 17:08 matheusdavidson

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.