diff --git a/js/angular/service/loading.js b/js/angular/service/loading.js index fe7f73cf0c..3166614670 100644 --- a/js/angular/service/loading.js +++ b/js/angular/service/loading.js @@ -177,7 +177,7 @@ function($ionicLoadingConfig, $ionicBody, $ionicTemplateLoader, $ionicBackdrop, } function showLoader(options) { - options = extend($ionicLoadingConfig || {}, options || {}); + options = extend({}, $ionicLoadingConfig || {}, options || {}); var delay = options.delay || options.showDelay || 0; //If loading.show() was called previously, cancel it and show with our new options diff --git a/test/unit/angular/service/loading.unit.js b/test/unit/angular/service/loading.unit.js index 36f0a9cf69..fe4c328259 100644 --- a/test/unit/angular/service/loading.unit.js +++ b/test/unit/angular/service/loading.unit.js @@ -216,5 +216,19 @@ describe('$ionicLoadingConfig', function() { expect(loader.element.text()).toBe('some other template'); })); + it('should use the original defaults with subsequent calls', inject(function($ionicLoading, $timeout) { + var loader = TestUtil.unwrapPromise($ionicLoading._getLoader()); + $ionicLoading.show({ + template: 'some other template' + }); + $timeout.flush(); + expect(loader.element.text()).toBe('some other template'); + $ionicLoading.hide(); + $timeout.flush(); + $ionicLoading.show(); + $timeout.flush(); + expect(loader.element.text()).toBe('some template'); + })); + });