Angularjs $mdDialog not opening modal on passing this. Why?
I'm trying to access parent controller data in child controller. Data is passing but the modal is not opening. When I print the response it shows
Cannot read property 'createDocumentFragment' of undefined
var ctrl = this;
ctrl.add_user_popup = function(data){
$mdDialog.show({
templateUrl: 'userManagement/addUserPopup.html',
controller: 'addUserPopup_controller',
controllerAs: 'umpctrl',
clickOutsideToClose: true,
dataToEdit: data,
escapeToClose: true,
parent: ctrl //When I comment this line modal opens
}).then(function(response){
console.log('add_user_popup success',response);
}, function(res){
console.log('add_user_popup failed',response);
})
}
Use the
localsproperty of the dialog options object.From the Docs:
For more information, see