Topic: Angular mdb-select bugs/features
Hello,
I have a couple of things related to the Angular mdb-select, as well as some feature suggestions, so I'm posting this in 1 topic,
This is my old code (before mdbootstrap)
<label for="selectEdit">Select a view to edit.</label> <select class="form-control" id="selectEdit" [(ngModel)]="viewToEdit" (ngModelChange)="editView()" required> <option *ngFor='let item of editableViews' [ngValue]="item">{{item.name}}</option> </select>
This is the new code:<mdb-select [options]="editableViewOpts" [(ngModel)]="viewToEdit" (selected)="editView()"></mdb-select> <label>Select a view to edit.</label> (Although the model has the same name, it changed from an object to a string in the code) To migrate I need quite some changes (and I have a lot of select boxes).
- My model used to be an object which was selected from a list of these objects, now the model needs to be a number or a string.
- It would be nice to allow the <option> syntax as for the regular select.
- It would be nice to allow the value to be an object. Now you need to lookup the object after the select happened, which is not very nice.
- On top, id 0 does not seem to work! (This is a bug for me). The simple workaround for not being able to use objects as values is to use the index in the array, which includes 0
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Resolved
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: Yes
- Provided link: No
Damian Gemza staff commented 6 years ago
Dear fonzzz, Thanks for your suggestions! We will take your suggestions into mind when developing a new version of Material Select. Best Regards, Damian