Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 82532d1

Browse files
fix(modal): opening a modal should not change default options
Closes #935
1 parent dd99f35 commit 82532d1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/modal/modal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ angular.module('ui.bootstrap.modal', [])
231231
};
232232

233233
//merge and clean up options
234-
modalOptions = angular.extend(defaultOptions, modalOptions);
234+
modalOptions = angular.extend({}, defaultOptions, modalOptions);
235235
modalOptions.resolve = modalOptions.resolve || {};
236236

237237
//verify options

src/modal/test/modal.spec.js

+9
Original file line numberDiff line numberDiff line change
@@ -399,5 +399,14 @@ describe('$modal', function () {
399399

400400
expect($document).toHaveModalsOpen(2);
401401
});
402+
403+
it('multiple modals should not interfere with default options', function () {
404+
405+
var modal1 = open({template: '<div>Modal1</div>', backdrop: false});
406+
var modal2 = open({template: '<div>Modal2</div>'});
407+
$rootScope.$digest();
408+
409+
expect($document).toHaveBackdrop();
410+
});
402411
});
403412
});

0 commit comments

Comments
 (0)