I'm launching a modal from my web page and i'm making some changes to an array that i'm passing from my parent, but before I send the updated results back after closing the modal my parent scope object is getting updated. If the user changed the mind not to update and then cancel the modal I don't want those changes to be seen on my parent controller
Parent Controller Code:
const modalInstance = $modal.open({ templateUrl: '/app/modal.html', controller: 'modalController', controllerAs: 'modal', resolve: {
mappedData: () => parentCntrl.groupData } });modalInstance.result.then(result => { if (result) { parentCntrl.groupData = result; } });
Child Controller Code:
modal.ok = () => { $modalInstance.close(modal.mappedData); };
modal.close = () => { $modalInstance.close(); };