我有主控制器
$scope.showDialog = function(ev) {
$mdDialog.show({
controller: 'DialogController',
templateUrl: 'partials/dialog.tmpl.ejs',
targetEvent: ev
})
};
和对话框控制器
$scope.hide = function() {
$mdDialog.hide();
};
(对话指令I' m using来自角度材料)。 如何在从主控制器关闭对话窗口时观察?
答案 0 :(得分:1)
使用mdDialog
:
$mdDialog.show({
controller: 'DialogController',
templateUrl: 'partials/dialog.tmpl.ejs',
targetEvent: ev
}).then(function(data) {
// dialog was hidden with $mdDialog.hide()
}, function() {
// dialog was canceled with $mdDialog.cancel()
})