modal.html 1.41 KB
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title></title>
</head>

<body>
    <div ng-app="esNgAntd" ng-controller="mainCtrl">
        <div class="container" style="padding: 50px">
            <button ng-click="showModal()">Open Modal</button>
            <es-table columns="columns" ng-if="visible"></es-table>
            <!-- <es-modal visible="{{visible}}" title="Modal" on-cancel="handleCancel()" on-ok="handleOk()">
                <es-button>123123</es-button>
            </es-modal> -->
        </div>
    </div>
    <script src="https://cdn.staticfile.org/angular.js/1.2.28/angular.min.js"></script>
    <script src="../dist/ng-antd.js"></script>
    <script>
        angular
            .module("esNgAntd")
            .controller("mainCtrl", function ($scope) {
                $scope.columns = [{
                    title: "AAA",
                    key: "aaa"
                }]
                $scope.visible = true;
                $scope.footer = `<es-button ng-click="handleCancel()">确认可以</es-button>`;
                $scope.showModal = function () {
                    $scope.visible =  !$scope.visible;
                }
                $scope.handleCancel = function() {
                    $scope.visible = false;
                }
                $scope.handleOk = function() {
                    $scope.visible = false;
                }
            });
    </script>
</body>

</html>