From 003659b65e1f24ea4ef2dc43479fc9717921cf84 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Thu, 22 May 2014 14:01:54 -0500 Subject: [PATCH] fix(modal): error message for modal show after remove --- js/angular/service/modal.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/angular/service/modal.js b/js/angular/service/modal.js index 9e760eb73d..e9110c3a73 100644 --- a/js/angular/service/modal.js +++ b/js/angular/service/modal.js @@ -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.'); + return; + } + + console.log(self.scope); + var modalEl = jqLite(self.modalEl); self.el.classList.remove('hide');