2015-02-07 159 views
0

我正在使用angularjs创建模态弹出窗口。我从弹出窗口添加记录并显示其本身的记录列表。我们还需要在弹出窗口上执行删除操作,如果用户尝试删除操作,它会显示一个确认模式弹出窗口,它将在当前弹出窗口中实际弹出。任何想法我们如何能够实现这一点。我正在使用角度UI与引导。在其他模态弹出窗口内创建模态弹出

回答

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 
      }); 
     }; 
    });