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

Commit 0ad208d

Browse files
onjirowesleycho
authored andcommitted
feat(modal): pass reason when opened promise rejected
Closes #2978
1 parent 489961e commit 0ad208d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/modal/modal.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ angular.module('ui.bootstrap.modal', [])
458458

459459
templateAndResolvePromise.then(function () {
460460
modalOpenedDeferred.resolve(true);
461-
}, function () {
462-
modalOpenedDeferred.reject(false);
461+
}, function (reason) {
462+
modalOpenedDeferred.reject(reason);
463463
});
464464

465465
return modalInstance;

src/modal/test/modal.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ describe('$modal', function () {
231231
ok: function() {return $q.reject('ko');}
232232
}}
233233
);
234-
expect(modal.opened).toBeRejectedWith(false);
234+
expect(modal.opened).toBeRejectedWith('ko');
235235
});
236236

237237
it('should focus on the element that has autofocus attribute when the modal is open/reopen', function () {

0 commit comments

Comments
 (0)