ng-q-all-settled
v1.0.0
Published
adds Q's allSettled method to Angular's $q
Downloads
4
Maintainers
Readme
ng-q-all-settled
adds Q's allSettled method to Angular's $q, using code from this gist by @Aaronius
install
npm install ng-q-all-settled
usage
require('angular')
require('ng-q-all-settled')
var exampleApp = angular.module('exampleApp', ['qAllSettled'])
exampleApp.controller('exampleController', ['$scope', '$q', function ($scope, $q) {
$q.allSettled(promiseArray).then(function (settledPromiseArray) {
// executed if all promises are resolved
}).catch(function () {
// executed if any promises are rejected
}).finally(function () {
// executed when all promises have settled
})
}])