Hello!
I have two modals ( new and edit ):
.controller('CustomFilterCtrl', function($scope, .... and other params) {
$ionicModal.fromTemplateUrl('templates/customFilter-new.html', function(modal) {
$scope.newCustomFilterModal = modal;
}, {
animation: 'slide-in-up',
focusFirstInput: true
});
$ionicModal.fromTemplateUrl('templates/customFilter-edit.html', function(modal) {
$scope.editCustomFilterModal = modal;
}, {
animation: 'slide-in-up'
});
}
and a controller for each modal defined from the view:
<ion-modal-view ng-controller="CustomFilterNewCtrl" class="slide-in-up">
and
<ion-modal-view ng-controller="CustomFilterEditCtrl" class="slide-in-up">
In each controller i have the $on(‘modal.shown’) function.
In the CustomFilterNewCtrl:
$scope.$on('modal.shown', function() {
// actions for the new modal
});
and in the CustomFilterEditCtrl:
$scope.$on('modal.shown', function() {
// actions for the edit modal
});
Problem: both the functions are executed when I open one of the modal! How can i fire the modal.shown on a specific modal?
Thanks