Blame view

example/input-number.html 1.37 KB
3a3ecabe   Imshann   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  <!DOCTYPE html>
  <html>
  
  <head>
      <meta charset="UTF-8" />
      <title></title>
      <link href="https://cdn.staticfile.org/antd/3.26.9/antd.css" rel="stylesheet" />
      <style>
          div.row {
              margin-bottom: 16px;
          }
      </style>
  </head>
  
  <body>
      <div ng-app="essa" ng-controller="mainCtrl">
          <div class="container" style="padding: 50px">
              <div class="row">
                  <es-input-number value="{{value}}" formatter="formatter(value)" parser="parser(value)" min="1" precision="2" style="width: 400px;" on-change="handleChange(value)"></es-input-number>
  
  
                  <es-input-number disabled="disabled"></es-input-number>
              </div>
          </div>
      </div>
      <script src="https://cdn.staticfile.org/angular.js/1.2.28/angular.min.js"></script>
      <script>
          angular
              .module("essa", [])
              .controller("mainCtrl", function ($scope) {
                  $scope.value = null;
                  $scope.formatter = function(value) {
                      return `¥${value}`;
                  }
                  $scope.parser = function(value) {
                      return value.replace("¥", "");
                  }
                  $scope.handleChange = function(value) {
                      console.log(value);
                  }
              });
      </script>
      <script src="../dist/ng-antd.bundle.js"></script>
  </body>
  
  </html>