Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs throw errors with Alpha 7 Angular RC 5 #978

Closed
naveedahmed1 opened this issue Aug 9, 2016 · 4 comments
Closed

Tabs throw errors with Alpha 7 Angular RC 5 #978

naveedahmed1 opened this issue Aug 9, 2016 · 4 comments

Comments

@naveedahmed1
Copy link

Hi,

After upgrading to Angular 2 RC 5 and Material 2 Alpha 5, the components using tabs through the below errors on browser console (though there aren't any compilation errors when compiling in VS 2015):

"Template parse errors:
Can't bind to 'portalHost' since it isn't a known property of 'template'. ("ex == i" [class.md-active]="selectedIndex == i" (click)="focusIndex = selectedIndex = i"> <template [ERROR ->][portalHost]="tab.label"></template> </div> <md-ink-bar></md-ink-bar> </div> <div class="md-tab-body-"): MdTabGroup@0:418
Property binding portalHost not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "directives" section. ("electedIndex == i" [class.md-active]="selectedIndex == i" (click)="focusIndex = selectedIndex = i"> [ERROR ->]<template [portalHost]="tab.label"></template> </div> <md-ink-bar></md-ink-bar> </div> <div class="md"): MdTabGroup@0:408
Can't bind to 'portalHost' since it isn't a known property of 'template'. (" == i" [attr.aria-labelledby]="_getTabLabelId(i)"> <template [ngIf]="selectedIndex == i"> <template [ERROR ->][portalHost]="tab.content"></template> </template> </div> </div> "): MdTabGroup@0:770
Property binding portalHost not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "directives" section. ("ectedIndex == i" [attr.aria-labelledby]="_getTabLabelId(i)"> <template [ngIf]="selectedIndex == i"> [ERROR ->]<template [portalHost]="tab.content"></template> </template> </div> </div> "): MdTabGroup@0:760"
@FoodBuster
Copy link

@naveedahmed1 If you're not using ngModules right now (i.e., if you're including directives in component files), try including "PORTAL_DIRECTIVES" from material/core in your component's directives list. Worked for me.

@biiiipy
Copy link

biiiipy commented Aug 10, 2016

@FoodBuster thanks for the tip! It's still a bug imho.
Also got this error:

zone.js:260 Uncaught TypeError: Cannot read property 'alignToElement' of undefined
MdTabGroup._updateInkBar @ tabs.js:124
(anonymous function) @ tabs.js:117
ZoneDelegate.invokeTask @ zone.js:356
Zone.runTask @ zone.js:256
ZoneTask.ZoneTask.cancelFn.invoke @ zone.js:423

@jelbourn
Copy link
Member

@naveedahmed1 Until you switch over to NgModules, you'll need to include MD_TABS_DIRECTIVES, TABS_INTERNAL_DIRECTIVES and PORTAL_DIRECTIVES in the directives list.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants