I am working with a group of 7 tabs using Angular material:
<mat-tab-group #tabGroup [selectedIndex]="selectedIndex">
<mat-tab label="Tab 1">Content 1</mat-tab>
<mat-tab label="Tab 2">Content 2</mat-tab>
<mat-tab label="Tab 3">Content 3</mat-tab>
<mat-tab label="Tab 4">Content 4</mat-tab>
<mat-tab label="Tab 5">Content 5</mat-tab>
<mat-tab label="Tab 6">Content 6</mat-tab>
<mat-tab label="Tab 7">Content 7</mat-tab>
</mat-tab-group>
My goal is to arrange the tabs in a specific order based on certain conditions.
In one scenario, I want tab7, tab5, tab6, tab1, tab2 ,tab3, tab4.
While I understand that the selectedIndex
property lets me control the active tab, I am looking for a way to set the order of the tabs upon loading.
Due to extensive data communication between the parent and tabs, I cannot use *ngFor. Is there a solution available without using *ngFor?
Does Angular Material provide a feature that allows for custom tab arrangement like this?