Reputation: 159
So I want to display content only if I clicked on tab. Is it possible? The reason why I want to achieve this is because when I filter through tabs, content is loaded while I'm typing in filter input
Upvotes: 1
Views: 866
Reputation: 57909
I dont like ::ng-deep, see the docs I always prefer create a class in styles.scss -or in styles.css-
.noFirst .mat-tab-labels:first-child > .mat-tab-label:first-child {
display: none;
}
Then when I want, add the class to mat-tab-group
<mat-tab-group class="noFirst">
<mat-tab></mat-tab>
<mat-tab label="First"> Content 1 </mat-tab>
....
</mat-tab-group>
Upvotes: 1