-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-quasar.min.js
1 lines (1 loc) · 1.97 KB
/
angular-quasar.min.js
1
!function(){"use strict";var a=function(a,b){return angular.isObject(b)&&b.data&&b.status&&b.headers&&b.config&&b.statusText&&angular.isFunction(b.headers)?a(b.data,b.status,b.headers,b.config):a(b)};angular.module("jutaz.quasar",[]).config(["$provide",function(b){b.decorator("$q",["$delegate",function(b){function c(b,e){return b.extended&&b._then&&b._finally?b:(b._then=b.then,b._finally=b["finally"],b.extended=!0,b._context=e?e._context:null,b.bind=function(a){return angular.isObject(a)&&(b._context=a),this},b.unbind=function(){return b._context=null,this},b["finally"]=function(a){return angular.isFunction(a)&&(a=a.bind(b._context)),this._finally(a)},b["catch"]=function(a){var c=arguments;return 1===c.length?b.then(null,a):b.then(null,function(a){for(var e=0;e<c.length;e++){if(e===c.length-1)return d.reject(a);if(a instanceof c[e])return c[c.length-1].call(b._context,a)}})},b.then=function(a,d,e){angular.isFunction(a)&&(a=a.bind(b._context)),angular.isFunction(d)&&(d=d.bind(b._context)),angular.isFunction(e)&&(e=e.bind(b._context));var f=b._then(a,d,e);return c(f,b)},b.success=function(c){return b.then(a.bind(void 0,c))},b.error=function(c){return b.then(null,a.bind(void 0,c))},b.spread=function(a){return b.then(function(c){return angular.isArray(c)?d.all(c).then(function(c){return a.apply(b._context,c)}):a.call(b._context,c)})},b.delay=b.timeout=function(a,e){if(angular.isNumber(a)&&angular.isFunction(e)){var f=a;a=e,e=f}var g=d.defer();return setTimeout(function(){b.then(a).then(g.resolve)},e),c(g.promise,b)},b.all=function(a){var c=b.then(function(a){return angular.isArray(a)||angular.isObject(a)?d.all(a):a}).then(a);return c},b)}var d={},e=angular.copy(b);return b=function(a){return c(e(a))},angular.forEach(e,function(a,b){d[b]=e[b]}),b.fcall=function(a){return b.when().then(a)},b.defer=function(){var a=d.defer();return c(a.promise),a},angular.forEach(e,function(a,e){angular.isFunction(d[e])&&"defer"!==e&&(b[e]=function(){return c(d[e].apply(this,arguments))})}),b}])}])}();