Blame view

example/modal.html 1.41 KB
3a3ecabe   Imshann   init
1
2
3
4
5
6
7
8
9
10
11
12
  <!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>
81f8a467   Imshann   调整组件前缀
13
14
15
16
              <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> -->
3a3ecabe   Imshann   init
17
18
19
20
21
22
23
24
          </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) {
81f8a467   Imshann   调整组件前缀
25
26
27
28
                  $scope.columns = [{
                      title: "AAA",
                      key: "aaa"
                  }]
3a3ecabe   Imshann   init
29
30
31
                  $scope.visible = true;
                  $scope.footer = `<es-button ng-click="handleCancel()">确认可以</es-button>`;
                  $scope.showModal = function () {
81f8a467   Imshann   调整组件前缀
32
                      $scope.visible =  !$scope.visible;
3a3ecabe   Imshann   init
33
34
35
36
37
38
39
40
41
42
43
44
                  }
                  $scope.handleCancel = function() {
                      $scope.visible = false;
                  }
                  $scope.handleOk = function() {
                      $scope.visible = false;
                  }
              });
      </script>
  </body>
  
  </html>