当我刚刚打开子对话框时,我需要关闭父对话框,我该如何实现?
我尝试在打开子对话框之前使用关闭 API,父对话框已关闭,但子对话框中所需的所有数据都将未定义。如果我不关闭它,可以很好地显示子对话框中的数据。
$scope.selectServerToOpen = function (serverType) {
var newScope = $scope.$new(true);
newScope.newServer = $scope.newServer;
$scope.closeThisDialog('cancel');//coment this line, the data can be passed correctly, but i need to close the parent dialog when i open the child dialog
modalInstance = ngDialog.open
template: 'servers/templates/servers-new.tpl.html',
scope: newScope,
controller: 'newServerCtrl',
resolve: {
serverData: function () {
return null;
},
delegate: callbackWrapper
}
});