I am using the typehead directive to autocomplete a list of states. The list contains a bunch of objects as follows
{
StateId: 0,
StateCode: "AK",
StateDesc: "ALASKA"
}
The typehead HTML is as follows
typeahead="state.StateCode for state in States | filter:$viewValue | limitTo:8"
This works great as is however I'd like to improve it a little bit.
Is it possible to have the autocomplete dropdown to show (and search on) StateDesc
but once you click on the drop down item the textbox was populated with StateCode
?
Thanks!