1

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

Kruno
  • 121
  • 1
  • 1
  • 13
  • Alright I found this as an solution. Is this good way to achieve this? https://stackoverflow.com/a/53818913/10741524 – Kruno Dec 07 '20 at 15:34

1 Answers1

1

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>
Eliseo
  • 50,109
  • 4
  • 29
  • 67
  • I do have question in regards to mat table and it seems you have expertise here can you please help me to resolve this mat table issue?https://stackoverflow.com/questions/65347251/how-to-show-split-header-in-the-material-table-having-nested-group-of-data-in-an – app Dec 18 '20 at 13:35