Skip to content
Advertisement

md-autocomplete when selecting a dropdown item object it says [Object Object]

JavaScript

I have this autocomplete and right now selectedOfficial returns [Object Object] in my drop down once I select an option. The drop down options as of now display perfectly, the name and email. But once I select the user, I want only the users name to show as the final selected option. Right now I am using selectedOfficial in my method submitO because it has an associated sys_ID with it that i need to reference.

so the selectedOfficial object looks as so:

JavaScript

right now when I hit submitO, it references selectedOfficial and I use the sys_id for a call that I need.

so the question here is, how do I make the dropdown say the display name

I tried md-selected-item=”selectedOfficial.name.value” and it still says [Object Object] I even tried item.name.value in the md-select and it still does [object object]

is there some sort of hacky way I can make the dropdown say the objects name value??? I am very stuck and need some help on this its the last piece of the puzzle that I cannot figure out. thanks in advance

Advertisement

Answer

md-item-text="item.user.display_value" should be item.name.display_value

Advertisement