Cannot set default value for Material select

Paperfree pro asked 9 months ago

Hello!

I am using material-select component with MDB Angular Pro.

I can't set default selected option.

Please, help. The code below doesn't work.

        this.optionsSelect = [
            { value: '1', label: 'Option 1' },
            { value: '2', label: 'Option 2' },
            { value: '3', label: 'Option 3', selected: true },
        ];

Thank you!


Damian Gemza answered 9 months ago

Hello Paperfree,

Please read this topic. There's everything described: https://mdbootstrap.com/support/default-value-select-angular/

Best Regards,

Damian


Paperfree pro commented 9 months ago

Thank you. It is working!


Please insert min. 20 characters.
Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No