Blame view

example/form.html 1.96 KB
3a3ecabe   Imshann   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <!DOCTYPE html>
  <html>
  
  <head>
      <meta charset="UTF-8" />
      <title></title>
      <style>
          .container {
              width: 800px;
          }
      </style>
  </head>
  
  <body>
      <div ng-app="esNgAntd" ng-controller="mainCtrl">
          <div class="container" style="padding: 50px">
dd962f77   Imshann   优化
17
              <es-form name="basic" on-finish="onFinish(values)" form="form">
3a3ecabe   Imshann   init
18
19
20
                  <es-form-item label="username" name="username">
                      <es-input></es-input>
                  </es-form-item>
dd962f77   Imshann   优化
21
22
23
24
25
26
                  <es-form-item label="area" name="area">
                      <es-select>
                          <es-select-option value="aaa">AAA</es-select-option>
                          <es-select-option value="bbb">BBB</es-select-option>
                      </es-select>
                  </es-form-item>
3a3ecabe   Imshann   init
27
28
                  <es-form-item>
                      <es-button type="primary" html-type="submit">Submit</es-button>
dd962f77   Imshann   优化
29
                      <es-button type="primary" html-type="button" ng-click="onReset()">Reset</es-button>
3a3ecabe   Imshann   init
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
                  </es-form-item>
              </es-form>
  
              <!-- <es-form label-col="{span:10}" wrapper-col="{span:14}">
                  <es-form-item label="username">
                      <es-input></es-input>
                  </es-form-item>
                  <es-form-item label="password">
                      <es-input></es-input>
                  </es-form-item>
              </es-form> -->
          </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) {
dd962f77   Imshann   优化
49
50
                  $scope.form = null;
  
3a3ecabe   Imshann   init
51
52
53
                  $scope.onFinish = function (values) {
                      console.log(values)
                  };
dd962f77   Imshann   优化
54
55
56
57
  
                  $scope.onReset = function() {
                      $scope.form.resetFields();
                  }
3a3ecabe   Imshann   init
58
59
60
61
62
              });
      </script>
  </body>
  
  </html>