I am have to do things like when user changed any form element and trying to go back without saving form or trying to go other page from tabs so i have to ask for confirm really want to exit. i am doing this
var foo = $scope.$on('$stateChangeStart', function(event)
{
event.preventDefault();
$ionicPopup.confirm({
title: 'some title'
}).then(function (res)
{
console.log(res);
if (res)
{
$state.go('stateName')
}
else
{
return;
}
});
});
$scope.$on('$destroy', foo)
But page cannot changed but page goes to blank. like
Thanks