What I am trying to achieve here is I wanna wrap the angular material tabs component with in my shared components.
So, here is the component that I'm trying to wrap:
PS: I can display component in each tab:
<mat-tab-group>
<mat-tab label="First"> Content 1 </mat-tab>
<mat-tab label="Second"> Content 2 </mat-tab>
<mat-tab label="Third"> Content 3 </mat-tab>
</mat-tab-group>
So, I wanna use wrapper for it to use it like:
<app-wrapper>
<app-item>
<app-item-header title="first"></app-item-header>
<app-item-content>
<app-needs-to-be-displayed></app-needs-to-be-displayed>
</app-item-content>
</app-item>
</app-wrapper>
app-wrapper.html
<mat-tab-group>
<ng-content></ng-content>
</mat-tab-group>
no changes in the TS class
app-item.html
<mat-tab>
<ng-content></ng-content>
</mat-tab>
no changes in the TS class
app-item-header.html
<ng-template mat-tab-label>
{{title}}
</ng-template>
app-item-header.ts class
@Input() title:string = ''
app-item-content.html
<div>
<ng-content></ng-content>
</div>
no changes in the TS class and this can hold an actual component
This gives no error in the console but nothing appears on the page too.
and here is working stackblitz version
https://stackblitz.com/edit/angular-wrapping-component-with-ng-content
PS : Please advice guys if this is the best solution to achieve this or there is another solution ?