Utilizing AngularStrap typeahead for address suggestions, I am facing an issue where I want to set the selected address object as my ng-model, but doing so causes me to lose the ability to display just one property of the object as the label.
Here is an example of the returned object:
{ formatted: '1001 Main St', geo: { lat: '123', lng: '234' } }
Within the view:
<input type="text" class="form-control" ng-model="item.venue" ng-options="address as address.formatted for address in getLocation($viewValue)" placeholder="Enter address" bs-typeahead>
Venue Object: {{ item.venue }}
I expected the above code to work, but unfortunately it does not assign "formatted" as the label value - it appears blank after selection. However, using the following workaround assigns only the formatted property to the model:
<input type="text" class="form-control" ng-model="item.venue" ng-options="address. address.formatted as address.formatted for address in getLocation($viewValue)" placeholder="Enter address" bs-typeahead>