1) Create a Modal like:
2) Define a scope variable "user", based on that Modal on the index page
3) Create a simple page to run the Modal and show the global variable "user" like:
4) Create a simple modal with the same struncture as a page above (to show the variable "user" and change it's property):
5) Open the Modal you've created from the page of your application with a JS code below:
prevar modalOptions = { // About Ionic Modal: https://links.appery.io/ve-snippet-modal-ionic
animation: 'slide-in-up', // The animation to show & hide with
focusFirstInput: false, // Whether to autofocus the first input of the modal when shown
backdropClickToClose: true, // Whether to close the modal on clicking the backdrop
hardwareBackButtonClose: true // Whether the modal can be closed using the hardware back button on Android and similar devices
};
Apperyio.get('Modals').loadModal("Modal1").then(
function(modalInstance) {
modalInstance.open(modalOptions).then(function(modal) {
modal.scope.modal = modal;
modal.scope.user = $scope.user;
modal.show();
});
},
function(error) {
console.log(error);
});
/pre
6) Run the application. You can change user's name on the page and see it's value on the Modal and backward (change user's address on the modal and see this value on the page)