我正在使用angularjs来创建模态弹出窗口。我正在从弹出窗口添加记录并显示其自身的记录列表。我们还需要在弹出窗口上执行删除操作,如果用户尝试删除,它会显示一个确认模式弹出窗口,它实际上会在当前弹出窗口中弹出。我们怎么能想到这个呢?我正在使用带引导程序的角度UI。
答案 0 :(得分:1)
触发弹出模型的链接
<a href="" ng-click="openConfirmWithPreCloseCallbackInlinedWithNestedConfirm()">Open confirm modal with pre-close inlined with nested confirm.</a>
角度应用:
var app = angular.module('exampleDialog', ['ngDialog']);
app.controller('MainCtrl', function ($scope, $rootScope, ngDialog) {
$scope.openConfirmWithPreCloseCallbackInlinedWithNestedConfirm = function () {
ngDialog.openConfirm({
template: 'dialogWithNestedConfirmDialogId',
className: 'ngdialog-theme-default',
preCloseCallback: function(value) {
var nestedConfirmDialog = ngDialog.openConfirm({
template:
'<p>Are you sure you want to close the parent dialog?</p>' +
'<div class="ngdialog-buttons">' +
'<button type="button" class="ngdialog-button ngdialog-button-secondary" ng-click="closeThisDialog(0)">No' +
'<button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirm(1)">Yes' +
'</button></div>',
plain: true,
className: 'ngdialog-theme-default'
});
return nestedConfirmDialog;
},
scope: $scope
});
};
});