Open lucasbraum opened 7 years ago
Currently, no: the modal is always created with its own controller. But you can easily pass data between controllers using the inputs
argument in showModal
. This same inputs
can be manipulated in your modal and the changes will be available in the close
callback:
ModalService.showModal( {
inputs : {
sensor: {id: 3, name: "lala"},
otherData: "something"
},
cancelable : true
} ).then( function( result ){
console.log( result.inputs.sensor );
console.log( result.inputs.otherData );
});
This should cover most of the usecases.
Is it possible to pass the controller instance to the Modal so they share the same $scope?
I am opening the Modal from my controller but it is not sharing the same $scope.
Thanks