I want to create a dynamic tabs loader using angular 2 material this is the syntax which I want to support角度2ダイナミックタブローダー
<generic-tabs [tabs]="tabs" tabVisibleField="name">
<test-cmp [tabContent] testData="hello"></test-cmp>
<test-cmp [tabContent] testData="hello from cmp one"></test-cmp>
<test-cmp [tabContent] testData="hello from cmp 2"></test-cmp></generic-tabs>
And inside the component I want to render tabs using material design and bind to each tab a component which contains tabContent This is the template for generic tabs
<md-tab-group *ngIf="componentsReferences && componentsReferences.length > 0">
<md-tab *ngFor="let componentRef of componentsReferences; let i=index" (click)="onTabClick($event, i)">
<template md-tab-label>{{getDisplayField(i)}}</template>
<template md-tab-content>
//inject the component for this tab
</template>
</md-tab>
</md-tab-group>
What I don't know is how to select all the component which are are inside the generic-tabs tag and make angular to create them
これは私が今けどうまくいかなかった場合まで行うことを試みたものです。 rc-06で作成するget embededViewは関数ではありませんhttps://plnkr.co/edit/TdLZghoOstRqcItmrJg3?p=preview – Nicu
これはrc-0.6でそのplunkと似たようなエラーです browser_adapter.ts:82元の例外:例外TypeError:ヌル – Nicu
browser_adapter.tsのプロパティ 'createEmbeddedView' を読み取ることができません:82 TypeError例外を:ViewContainerRef_.createEmbeddedView(core.umd.js:8344)のヌル のプロパティ 'createEmbeddedView' を読み取ることができませんViewContainerRef_.createEmbeddedViewで (コア.umd.js:8344) NgTemplateOutlet.ngOnChangesで(common.umd.js:1236) DebugAppView._View_GenericTabsComponent5.detectChangesInternalで(GenericTabsComponent.ngfactory.js:369) DebugAppView.AppView.detectChangesで(core.umd.js :12586)Debの ugAppView.detectChanges(core.umd.js:12691) – Nicu