Home > front end >  I am using for loop to display the tabs from api response in Angular
I am using for loop to display the tabs from api response in Angular

Time:11-13

app.component.html:

  <mat-tab-group animationDuration="0ms">
            <mat-tab [label]="tab" *ngFor="let tab of tabNames">

           content..........


            </mat-tab>
          </mat-tab-group>

In the data i have 4 object that objects should be displayed as tabs. and i should not display one tab of 1_exists in mat-tab row.please help me to solve this. Thanks.

CodePudding user response:

You can skip the first element, or get any subset of your array, using the slice pipe:

<mat-tab [label]="tab" *ngFor="let tab of tabNames | slice:1">

Also, for future questions, please remember this: How much research effort is expected of Stack Overflow users?. Posting a new question should be your last resort.

And this How do I ask a good question? so we can help you with better answers.

  • Related