Skip to content

Commit

Permalink
fix(modal): error message for modal show after remove
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed May 22, 2014
1 parent c340951 commit 003659b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/angular/service/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ function($rootScope, $document, $compile, $timeout, $ionicPlatform, $ionicTempla
*/
show: function() {
var self = this;

if(self.scope.$$destroyed) {
console.error('Cannot call modal.show() after remove(). Please create a new modal instance using $ionicModal.');

This comment has been minimized.

Copy link
@ajoslin

ajoslin May 22, 2014

Contributor

Should probably mention using hide() instead if they want to reuse the modal.

return;
}

console.log(self.scope);

var modalEl = jqLite(self.modalEl);

self.el.classList.remove('hide');
Expand Down

0 comments on commit 003659b

Please sign in to comment.