Angular JS - v1.2.0-rc.3 Angular Bootstrap - 0.12.0
Controller:
app.controller('controlsController', ['$scope', '$http', function($scope, $http) {
$scope.selected = undefined;
$scope.getLocation = function(val) {
return $http.get('http://maps.googleapis.com/maps/api/geocode/json', {
params: {
address: val,
sensor: false
}
}).success(function(response){
return response.data.results.map(function(item){
return item.formatted_address;
});
});
};
}]);
Jade:
input(type='text'
ng-model='asyncSelected'
placeholder='find...'
typeahead='address for address in getLocation($viewValue)'
typeahead-loading='loadingLocations'
class='form-control')
Result:
Nothing
I have tried putting a button that calls getLocation in place of the input and it calls the function OK. Any ideas?
ui.bootstrapto your app ? - sylwester