Topic: mdb-select options others than "value" and "label"
Hello,
In all code samples to the mdb-select component, the options are set as the following:
this.optionsSelect = [
{ value: '1', label: 'Option 1' },
{ value: '2', label: 'Option 2' },
{ value: '3', label: 'Option 3' },
];
So once I have an array of objects with id and name properties I have to convert it to an array of objects with the properties value and label, what I would prefer not to.
The question: is there any way to configure the mdb-select component so it uses my id property for the value and the name property for the label?
Arkadiusz Idzikowski
staff answered 2 years ago
Hello,
It's not possible in the current version. For now you need to convert your objects so they have value and label properties.
Resolved
- User: Free
- Premium support: No
- Technology: Angular
- MDB Version: 7.5.0
- Device: Any
- Browser: Any
- OS: Any
- Provided sample code: No
- Provided link: No