How can I make a controller for an $ionicModal

Is it possible to make a controller for an $ionicModal like AngularJS UI Bootstrap $modal ?

here is an example :

You just have to pass a controller as a callback or pass the controller name as a string

You can check these link.$ionicModal/

There are code example with controller too.

Thank you for trying to help, but this is using the parent $scope, it’s not isolated, so it’s using the MainCtrl not an isolated controller for the modal only,

You can use custom controller in:

 <script id="modal.html" type="text/ng-template">
  <ion-modal-view ng-controller="ModalCtrl">

please check for details:

1 Like