I'm pretty sure I'm doing this right so I don't know why it's not working, maybe I'm missing something obvious. Here's the input that is supposed to have typeahead:
<input type="text" class="form-control" typeahead-min-length="4" typeahead-loading="loadingLocations" ng-model="modal.modalObject.facility_id" ng-required="true" typeahead="fac.id as fac.facility_name for fac in modal.parentCtrl.queryFacilities($viewValue)" />
<i ng-show="loadingLocations" class="glyphicon glyphicon-refresh"></i>
And then in the back end I'm doing this:
this.queryFacilities = function(query){
qualificationFactory.queryFacilities(query).then(function(data){
return data;
},function(error){
$log.error(error);
});
};
Which is returning
[
{
"id": 1,
"facility_name": "Facility 1",
"address": "",
"city": "",
"state": "",
"zip": 012345
},
{
...
}
]
I can see the http request succceed when I type, but the intput does nothing. What gives?
Thanks :)
I had to return the value as a promise because the return inside of the http was not getting returned by
queryFacilities