Topic: Object as mdb-option [value]
Expected behavior
I would like to add objects (not strings) as [value] parameter of mdb-option, BUT show 
other some property of the selected object in the autocomplete field.
I'm looking for something like displayWith in angular-material autocomplete:https://material.angular.io/components/autocomplete/overview
Actual behavior
When I use object as mdb-option value, I'm getting [object Object] in the completer input field.
I tried (select) and override the input, but sometimes the internal select function runs slower and finally I've got [object Object] back.
Resources (screenshots, code snippets etc.)
I wanted to insert a code but this thing can't format it :(
                                                    
                                                    Arkadiusz Idzikowski
                                             staff                                             answered 6 years ago                                        
Unfortunately we don't have any feature similar to displayWith in current version. I agree that this is must have for this component. I already created task with high priority for that.
                                                    
                                                    bitmads
                                             pro  premium                                             answered 6 years ago                                        
                                                    
                                                    pzimmer
                                             pro  premium  priority                                             answered 4 years ago                                        
I have this issue as well. There is a [displayValue]="onDisplayValue" attribute that allows you to have a function (onDisplayValue) that will take the option and return the string to display, but the angular does not compile when you have an object for the value.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
 - Premium support: Yes
 - Technology: MDB Angular
 - MDB Version: 8.1.1
 - Device: PC
 - Browser: Chrome
 - OS: Windows 10
 - Provided sample code: No
 - Provided link: Yes