Closed johngeorgewright closed 9 years ago
Thanks for the pull request but why not simply pass the $promise to cg-busy? Something like:
<div cg-busy="blogs.$promise">
Oh yeh. Didn't think of doing that.
@cgross, using ".$promise" kind of defeats the ease of use of the directive don't you think? If it can support both promises in the form of an object as an array, why not just accept the pull request?
Been open for a while... unsure if it's needed anymore.
Until now we could only except an object with a promise property or an array of promises. What I need to achieve is using angular-busy with an array with a promise property.
This commonly happens when using angular's
$resource
service and the server responds with an array rather than an object.function BlogFactory($resource) { return $resource.service('/blogs'); } function BlogCtrl(Blog, $scope) { $scope.blogs = Blog.query(); }
When we use syntax like this we get an array with a promise property. A bit like doing this:
$scope.blogs = []; $scope.blogs.$promise = $q.defer().promise;