ng-q-all-settled

1.0.0 • Public • Published

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
  })
 
}])
 

Package Sidebar

Install

npm i ng-q-all-settled

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • data-doge