I am getting the following error when I attempt to get a typeahead values from AngularUI-Bootstrap, using a promise.
TypeError: Cannot read property \'length
$scope.getTypeaheadValues = function($viewValue)
{
var someOutput="";//return something
$http({
method: 'GET',
url: 'api/v1/person?name__icontains=' + $viewValue
}).error(function (data) {
console.error(data);
}).success(function (data) {
console.log(data);//Do whatever you want
});
return someOutput;
}
//The return statement is missing