What am I doing wrong? search() works when called within the controller but not when called through ng-click="search()"
$scope.search = () => {
$scope.getLocation()
.then(location => xhr('/venues/search', { lat: location.lat, lng: location.lng, category: $scope.category }))
.then(data => {
$scope.venues = data;
$scope.apply();
});
}