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

Select mat-option without changing mat-select value

Discussão em 'Angular' iniciado por Graf, Maio 7, 2025.

  1. Graf

    Graf Guest

    I want to incorporate a select all option in a mat-select similar to: https://angular-material.dev/articles/mat-select-all

    however, since my project is on angular 12 I can't select an option without triggering an event this._matOption.select(false); This leads to the 'select-all' value of this option to show up in the value of the mat-select.

    Is there any way to display the option as selected without having its value show up in the value of mat-select? One way would be to encapsulate the mat select in a custom component, where I can directly control the value, however this reduces flexibility quite a lot, which I don't like.

    Continue reading...

Compartilhe esta Página