Reputation: 533
I have an example where I need to use nested tabs and tables.
https://stackblitz.com/edit/angular-bgl1f2
When I switch parent tabs (View M2) and then try to switch child tabs (M3), the tabs do not render. Rendering occurs only after switching child tabs (M3) multiple times.
Steps to Reproduce in the above Stackblitz:
Expected Result
A table should be displayed in child tab (M3 33 C)
Actual Result
Nothing is rendered in child tab (M3 33 C)
When you switch to a different child tab and then back to child tab (M3 33 C), table is displayed.
Can anyone point out what is wrong?
Upvotes: 6
Views: 893
Reputation: 19
I know, i know a bit late. But i stumbled over this post in quest for a solution.
And i found one after all!
So here to share, and give back to the community
<ng-template matTabContent>
did the trick for me
<mat-tab>
<ng-template matTabContent>
<div class="example-tab-content">
...
</div>
</ng-template>
</mat-tab>
Upvotes: 0