I am wondering if you can pass a controller to the $ionicModal service. Something like.
$ionicModal.fromTemplateUrl('templates/login.html', {
scope: $scope,
controller: 'MyModalCotroller'
})
A little context: I would like to have a modal that is distributed across the app and I dont want to repeat all the methods (hide, show, buttons inside the modal) in every controller and I would like to remove the methods from the 'Main Controller' to keep things clean. This would encapsulate the functionality of the modal.
Is there a way to do this.?
Thanks
question from:
https://stackoverflow.com/questions/27434262/pass-a-controller-to-ionicmodal 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…