How to create 3 level drop down options in angular. We can make use of angular-material?

209 views
Skip to first unread message

Amarjit kumar Singh

unread,
Jun 8, 2019, 4:29:10 AM6/8/19
to Angular and AngularJS discussion

How to create 3 level drop down options in angular. We can make use of angular-material?

dropdown.PNG

<h4>mat-select</h4>
<mat-form-field>
  <mat-label>Pokemon</mat-label>
  <mat-select [formControl]="pokemonControl">
    <mat-option>-- None --</mat-option>
    <mat-optgroup *ngFor="let group of pokemonGroups" [label]="group.name"
                  [disabled]="group.disabled">
      <mat-option *ngFor="let pokemon of group.pokemon" [value]="pokemon.value">
        {{pokemon.viewValue}}
      </mat-option>
    </mat-optgroup>
  </mat-select>
</mat-form-field>





The above code has two level. But how can we make it to the  3 level. 
   Something like, 
   Label1 -> Option1 -> option1.1 and option1.2  
   Label1 -> Option2 -> option1.1 and option1.2 
   Label2 -> Option2 -> option1.1 and option1.2




Reply all
Reply to author
Forward
0 new messages