Upon clicking a button, a modal window appears. The controller assigned to the modal contains a list of element IDs that need listeners assigned. However, when the controller initializes, the modal has not yet rendered, causing the elements requiring listeners to be nonexistent at that time. I am currently exploring how to assign listeners to these elements after the modal has been displayed.
The code responsible for creating the modal is as follows:
ModalDialogFactory.showDialog(dialogOptions);
And inside the factory:
showDialog: function (modalOptions) {
var modalConfig = {};
angular.extend(modalConfig, modalDialogDefaults, modalOptions);
modalInstance = $modal.open(modalConfig);
modalInstance.opened.then(function() {
// Possibly in this section
})
return modalInstance.result;
}
Is there a method to access the controller functions of modalInstance after the modal has been displayed?