Let me prefix by saying this a very similar to my other question seen here where I could not close any nested modals. The issue was from my service creating the same instance of a modal where 'The second instance "overwrites" the first one', so my solution was to create separate instances using $scope.modalA = modal;
and $scope.modalB = modal;
and I could still use my service to handle modals, seen here:
.service('ModalService', function ($ionicModal, $ionicLoading, $rootScope) {
var init = function (tpl, $scope) {
$ionicLoading.show({
content : 'Loading',
animation : 'fade-in',
showBackdrop : true,
maxWidth : 200,
showDelay : 0
});
var promise;
$scope = $scope || $rootScope.$new();
promise = $ionicModal.fromTemplateUrl(tpl, {
scope : $scope,
animation : 'slide-in-up'
}).then(function (modal) {
$scope.modal = modal;
return modal;
});
$scope.$on('$destroy', function () {
$scope.modal.remove();
});
return promise;
}
return {
init : init
}
})
Now, I have a similar issue when using third party libraries where, as in this case, instead of not being able to close the nested modal, the third party libraries are unresponsive only when in my nested modal states. In other words when any third party modals are used like seen here
It is only my modal (the one in the background with activity 1 & 2) that is responsive to clicks. As I said I created the two instances $scope.modalA = modal;
and $scope.modalB = modal;
. to handle nested modal states however Im unaware how to handle this when using libraries. I would love some help on this, heres my codepen http://codepen.io/garrettmac/pen/NxmowX