From f937003e515bc6e8f0089d3e6bc2b8cdcec881ff Mon Sep 17 00:00:00 2001 From: Chris Conolly Date: Fri, 11 Dec 2015 16:58:11 +0000 Subject: [PATCH] Enabling angular-http-loader and angular-multimocks to work together - added package files --- app/package/js/angular-http-loader.js | 2 +- app/package/js/angular-http-loader.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package/js/angular-http-loader.js b/app/package/js/angular-http-loader.js index 475275e..ef55405 100644 --- a/app/package/js/angular-http-loader.js +++ b/app/package/js/angular-http-loader.js @@ -245,5 +245,5 @@ angular }) .config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('httpMethodInterceptor'); + $httpProvider.interceptors.unshift('httpMethodInterceptor'); }]); diff --git a/app/package/js/angular-http-loader.min.js b/app/package/js/angular-http-loader.min.js index 8806dae..fc4fe41 100644 --- a/app/package/js/angular-http-loader.min.js +++ b/app/package/js/angular-http-loader.min.js @@ -1 +1 @@ -angular.module("ng.httpLoader",["ng.httpLoader.httpMethodInterceptor"]).directive("ngHttpLoader",["$rootScope","$parse","$timeout",function(a,b,c){return{scope:{methods:"@",template:"@",title:"@",ttl:"@"},template:'
',link:function(d){var e=b(d.methods)()||d.methods;e=angular.isUndefined(e)?[]:e,e=angular.isArray(e)?e:[e],angular.forEach(e,function(a,b){e[b]=a.toUpperCase()});var f=b(d.ttl)()||d.ttl;f=angular.isUndefined(f)?0:f,f=1e3*Number(f),f=angular.isNumber(f)?f:0,Array.prototype.indexOf||(e.indexOf=function(a){for(var b=this.length;b--;)if(this[b]===a)return b;return-1}),d.showLoader=!1;var g,h=d.showLoader,i=function(a,b){return-1!==e.indexOf(b.toUpperCase())?h="loaderShow"===a.name:0===e.length&&(h="loaderShow"===a.name),0>=f||!g&&!h?void(d.showLoader=h):void(g||(d.showLoader=h,g=c(function(){h||(d.showLoader=h),g=void 0},f)))};a.$on("loaderShow",i),a.$on("loaderHide",i)}}}]),angular.module("ng.httpLoader.httpMethodInterceptor",[]).provider("httpMethodInterceptor",function(){var a=[],b=!1;this.whitelistDomain=function(b){a.push(b)},this.whitelistLocalRequests=function(){b=!0},this.$get=["$q","$rootScope",function(c,d){var e=0,f=function(c){if("//"!==c.substring(0,2)&&-1===c.indexOf("://")&&b)return!0;for(var d=a.length;d--;)if(-1!==c.indexOf(a[d]))return!0;return!1},g=function(a){f(a.url)&&0===--e&&d.$emit("loaderHide",a.method)};return{request:function(a){return f(a.url)&&(e++,d.$emit("loaderShow",a.method)),a||c.when(a)},response:function(a){return g(a.config),a||c.when(a)},responseError:function(a){return g(a.config),c.reject(a)}}}]}).config(["$httpProvider",function(a){a.interceptors.push("httpMethodInterceptor")}]); \ No newline at end of file +angular.module("ng.httpLoader",["ng.httpLoader.httpMethodInterceptor"]).directive("ngHttpLoader",["$rootScope","$parse","$timeout",function(a,b,c){return{scope:{methods:"@",template:"@",title:"@",ttl:"@"},template:'
',link:function(d){var e=b(d.methods)()||d.methods;e=angular.isUndefined(e)?[]:e,e=angular.isArray(e)?e:[e],angular.forEach(e,function(a,b){e[b]=a.toUpperCase()});var f=b(d.ttl)()||d.ttl;f=angular.isUndefined(f)?0:f,f=1e3*Number(f),f=angular.isNumber(f)?f:0,Array.prototype.indexOf||(e.indexOf=function(a){for(var b=this.length;b--;)if(this[b]===a)return b;return-1}),d.showLoader=!1;var g,h=d.showLoader,i=function(a,b){return-1!==e.indexOf(b.toUpperCase())?h="loaderShow"===a.name:0===e.length&&(h="loaderShow"===a.name),0>=f||!g&&!h?void(d.showLoader=h):void(g||(d.showLoader=h,g=c(function(){h||(d.showLoader=h),g=void 0},f)))};a.$on("loaderShow",i),a.$on("loaderHide",i)}}}]),angular.module("ng.httpLoader.httpMethodInterceptor",[]).provider("httpMethodInterceptor",function(){var a=[],b=!1;this.whitelistDomain=function(b){a.push(b)},this.whitelistLocalRequests=function(){b=!0},this.$get=["$q","$rootScope",function(c,d){var e=0,f=function(c){if("//"!==c.substring(0,2)&&-1===c.indexOf("://")&&b)return!0;for(var d=a.length;d--;)if(-1!==c.indexOf(a[d]))return!0;return!1},g=function(a){f(a.url)&&0===--e&&d.$emit("loaderHide",a.method)};return{request:function(a){return f(a.url)&&(e++,d.$emit("loaderShow",a.method)),a||c.when(a)},response:function(a){return g(a.config),a||c.when(a)},responseError:function(a){return g(a.config),c.reject(a)}}}]}).config(["$httpProvider",function(a){a.interceptors.unshift("httpMethodInterceptor")}]); \ No newline at end of file