Is there a way to dynamically pass a component on Angular (Material Tab Component) by list?

Viewed 37

The page is structured by a material tab group, the first tab contains a grid of customers (products, suppliers or whatever ...), the second should be the row selected on the grid of the first tab. My idea was to create a tab group component with the grid tab inside it and a mat-tab managed by a *ng-for that would cycle over an array with some properties including the component to open for the new tab.

<mat-tab-group>
    <mat-tab>
        <!--grid-->        
    </mat-tab>
    <mat-tab *ngFor="let tab of tabs; let index = index" [label]="tabs[index].name">
        <!--new dynamic component -->       
    </mat-tab>
</mat-tab-group>
0 Answers
Related