Hi!. 
  
I spent a few hours trying to get typeahead working with ajax calls. 
Everything else was fine except ... no dropdown.

This does not work....

 $scope.getLocation = function(val) {
    return $http.get('http://maps.googleapis.com/maps/api/geocode/json', {
      params: {
        address: val,
        sensor: false
      }
    }).
*success(function(data){*
*      return data*.results.map(function(item){
        return item.formatted_address;
      });
    });
  };


... and much,much later I noticed that this works .... 

$scope.getLocation = function(val) {
    return $http.get('http://maps.googleapis.com/maps/api/geocode/json', {
      params: {
        address: val,
        sensor: false
      }
    }).
*then(function(response){*
*      return response.data*.results.map(function(item){
        return item.formatted_address;
      });
    });
  };
 
Canyone explain why?


/Tapio

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to