1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

mat-select - mat-option sort values

Discussão em 'Angular' iniciado por Sox -, Julho 23, 2025.

  1. Sox -

    Sox - Guest

    I am new to Angular6 and I wanted to know if there is a simple way to do what I want.

    I just read documentation and I did not read anything about that, is there a easy way to sort the value in the dropdown ?

    <mat-form-field>
    <mat-select placeholder="Code List" required [(ngModel)]="contextScheme.codeListId">
    <mat-option *ngFor="let codeList of codeLists" [value]="codeList.codeListId">
    {{codeList.codeListName}}
    </mat-option>
    </mat-select>
    </mat-form-field>


    Basically the value I have are the values in my DB sorted by id, I want the exact thing but sorted in desc.

    Thank in advance.

    Sox-.

    Continue reading...

Compartilhe esta Página