I have open a template by using $mdDialog.show() like this:-
$mdDialog.show({
skipHide: true,
controller: 'EditController',
templateUrl: 'app/View/Edit.html',
parent: angular.element(document.body),
clickOutsideToClose: false
});
Now I am tring to show the alert before saving the data by using the $mdDialog.confirm() like this:-
var confirm = $mdDialog.confirm() .parent(angular.element(document.body))
.content('Are you sure to save the document? ')
.ok('Save')
.cancel('Cancel')
$mdDialog.show(confirm).then(function () {}
,function () { $mdDialog.hide();
});
Issue : Closing the opened template after opening the alert.
最佳答案
可以同时打开多个对话:
Using the
multiple
option for the $mdDialog service allows developers to show multiple dialogs at the same time.
示例:
// From plain options
$mdDialog.show({
multiple: true
});
// From a dialog preset
$mdDialog.show(
$mdDialog
.confirm()
.multiple(true)
);
这是 Reference为此。
关于angularjs - 使用 $mdDialog.confirm() 关闭父页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40583085/