diff --git a/src/modal/modal.js b/src/modal/modal.js index 662765d357..ced51bca09 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -400,8 +400,8 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.transition']) templateAndResolvePromise.then(function () { modalOpenedDeferred.resolve(true); - }, function () { - modalOpenedDeferred.reject(false); + }, function (reason) { + modalOpenedDeferred.reject(reason); }); return modalInstance; diff --git a/src/modal/test/modal.spec.js b/src/modal/test/modal.spec.js index d3424c06ed..15afe7b017 100644 --- a/src/modal/test/modal.spec.js +++ b/src/modal/test/modal.spec.js @@ -235,7 +235,7 @@ describe('$modal', function () { ok: function() {return $q.reject('ko');} }} ); - expect(modal.opened).toBeRejectedWith(false); + expect(modal.opened).toBeRejectedWith('ko'); }); });