What is the best way to handle promises in Angular.js with a resource that expects the query string / parameters passed to it? I saw the $ q work handled in the factory, controller, and router, but I'm not sure how to handle it anyway when the parameters are involved.
So if this is a 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 what is the best way to deal with promises? Invoking an external resource can take quite a while.
source share