What's the best way to handle promises in Angular.js with a resource that expects a query string / parameters passed to it? I've seen the job of $q handled in the factory, controller and router but I'm not sure how to handle it in any case when there's parameters involved.
So if this is the factory :
angular.module(Animals, ['$resource', '$route', '$location', function($resource, $route, $location) {
return $resource('http://thezoo.com/animals', { query: {method: 'GET', isArray: true}});
}]);
and this is the controller:
Animals.query({size="med",gender='f'});
then how should this best be handled using promises? The call to the external resource can take quite long.