Why am I having trouble retrieving the correct selected typeahead value using the ng-change function?
This is the code snippet:
<input
type="text"
ng-model="asyncSelected"
placeholder="Locations loaded via $http"
typeahead="address for address in getLocation($viewValue)"
typeahead-loading="loadingLocations"
class="form-control"
ng-change="change(asyncSelected)">
The issue is that the variable asyncSelected always returns the string that I typed, not the one selected via typeahead. You can see the problem in this Plunkr example. Just type something in it. I forked it from the official documentation of angular-ui-bootstrap.