mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
This commit is contained in:
2
js/angular/service/loading.js
vendored
2
js/angular/service/loading.js
vendored
@@ -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
|
||||
|
||||
@@ -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');
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user