1
부트 스트랩을 사용하여 탭 구성 요소를 만들려고합니다. for 루프의 ng-content
<app-tabs>
<app-tab [label]="'label1'">Description 1</app-tab>
<app-tab [label]="'label2'">Description 2</app-tab>
</app-tabs>
는이 기사에서 살펴했다 :
https://juristr.com/blog/2016/02/learning-ng2-creating-tab-component/ 을하지만 내 유스 케이스는 다르다.
for의 각 루프마다 다른 <ng-content>
을 사용해야합니다. 이것은 내 plunker입니다 : https://plnkr.co/edit/N2p8Vx?p=preview 두 번째 설명을 두 번째 탭에 인쇄하고 첫 번째 것은 비워 둡니다.
감사합니다.
대단히 @yurzui. 그게 제가 찾고 있던 해결책입니다. '* ngTemplateOutlet'을 시도했지만 TabComponent에 TemplateRef를 넣어야한다는 것을 몰랐습니다. 건배! – Breno