Hi everyone,
I’d like to know how could I open Popup when clicking on ion back button, and then on ‘confirm’ tap, load $ionicNavBarDelegate and execute its “back” method.
First part (open popup) is not a pb, but when I do this :
var popup = $ionicPopup.confirm({
title: 'Mytitle' ,
template: 'myTemp',
cancelType: 'button',
okType: 'button'
});
popup.then(function(confirmation) {
if(confirmation) {
$ionicNavBarDelegate.back();
} else {}
and call it on ionic back button touch through a ctrl, I got this error :
TypeError: Illegal invocation
at deprecatedWarning (http://localhost:8100/lib/ionic/release/js/ionic-angular.js:6173:13)
at self.back (http://localhost:8100/lib/ionic/release/js/ionic-angular.js:6164:5)
at http://localhost:8100/lib/ionic/release/js/ionic.js:98:46
at Array.forEach (native)
at DelegateInstance.caller [as back] (http://localhost:8100/lib/ionic/release/js/ionic.js:95:27)
at http://localhost:8100/scripts/controllers/restaurant-menu.js:83:27
at processQueue (http://localhost:8100/lib/angular/angular.js:13137:27)
at http://localhost:8100/lib/angular/angular.js:13153:27
at Scope.$eval (http://localhost:8100/lib/angular/angular.js:14353:28)
at Scope.$digest (http://localhost:8100/lib/angular/angular.js:14169:31)
Does someone know how invok this method ?
Does someone know how it works exactly ?
thanks,