adds Q's allSettled method to Angular's $q, using code from this gist by @Aaronius
npm install ng-q-all-settled
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
})
}])