Blame view

example/form.html 2.17 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">
fe17acf4   Imshann   优化组件
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
              <antd-form name="basic" on-finish="onFinish(values)" form="form">
                  <antd-form-item label="username" name="username">
                      <antd-input></antd-input>
                  </antd-form-item>
                  <antd-form-item label="area" name="area">
                      <antd-select>
                          <antd-select-option value="aaa">AAA</antd-select-option>
                          <antd-select-option value="bbb">BBB</antd-select-option>
                      </antd-select>
                  </antd-form-item>
                  <antd-form-item label="area" name="checkbox">
                      <antd-checkbox>Checkbox</antd-checkbox>
                  </antd-form-item>
                  <antd-form-item>
                      <antd-button type="primary" html-type="submit">Submit</antd-button>
                      <antd-button type="primary" html-type="button" ng-click="onReset()">Reset</antd-button>
                  </antd-form-item>
              </antd-form>
3a3ecabe   Imshann   init
35
  
fe17acf4   Imshann   优化组件
36
37
38
39
40
41
42
43
              <!-- <antd-form label-col="{span:10}" wrapper-col="{span:14}">
                  <antd-form-item label="username">
                      <antd-input></antd-input>
                  </antd-form-item>
                  <antd-form-item label="password">
                      <antd-input></antd-input>
                  </antd-form-item>
              </antd-form> -->
3a3ecabe   Imshann   init
44
45
46
47
48
49
50
51
          </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   优化
52
53
                  $scope.form = null;
  
3a3ecabe   Imshann   init
54
55
56
                  $scope.onFinish = function (values) {
                      console.log(values)
                  };
dd962f77   Imshann   优化
57
58
59
60
  
                  $scope.onReset = function() {
                      $scope.form.resetFields();
                  }
3a3ecabe   Imshann   init
61
62
63
64
65
              });
      </script>
  </body>
  
  </html>