You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the typeaheadOptionField input it is possibile to pick a specific property to be used when the source is an array of objects. But what if I wanted to show one of the object's property as the input value, but assign another object's property as the model value?
.. or even better to the entire object itself (sometimes very useful):
<input [(ngModel)]="customSelected" state
[typeahead]="let state of statesComplex"
typeaheadBindTo="state"
typeaheadOptionField ="state.name"
class="form-control">
The text was updated successfully, but these errors were encountered:
YevheniiaMazur
changed the title
Handling array of objects containing value/label pairs
feat(typeahead): Handling array of objects containing value/label pairs
Jan 16, 2018
With the
typeaheadOptionField
input it is possibile to pick a specific property to be used when the source is an array of objects. But what if I wanted to show one of the object's property as the input value, but assign another object's property as the model value?Say the source is something like this:
It is not possibile to make the user see the
name
property in the form control, and bind the model to theid
property instead. Something like.... or even better to the entire object itself (sometimes very useful):
The text was updated successfully, but these errors were encountered: