Is it possible or is there a better way I can run the execute function after $scope.found has been returned where the seeker function is initiated by an ng-click event.
$scope.adder = {
seeker:function(){
$scope.found = null;
$scope.found = $scope.services.find(function(service){
return service;
});
Loader.showLoading('Added to cart');
return $scope.found;
},
execute:function($scope,found){
if($scope.found != null){
$scope.cart.addItem(found.title, found.pricing, found.qty);
Loader.hideLoading();
}
}
}