this.$mdDialog.show({
controllerAs: 'ctrl',
resolve: {
product: product
},
controller:($mdDialog, product) => {
close() => {
$mdDialog.hide({productToUpdate: product}
}
},
templateUrl: 'product-dialog.tmpl.html',
parent: angular.element(document.body),
clickOutsideToClose: true,
}).then(productToUpdateOrDelete => { // on hide
cb(productToUpdateOrDelete);
}, () => { // on clickoutside or escape
// Need to run my cb() here with the modified product
});
}
I need to pass an object when $mdDialog is closed by escape and clickOutside.
Can't find anything about it in the docs. https://material.angularjs.org/latest/api/service/$mdDialog
Isn't it possible?