Blame view

example/list.html 1.12 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
  <!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>
      </style>
  </head>
  
  <body>
      <div ng-app="essa" ng-controller="mainCtrl">
          <div class="container" style="padding: 50px">
              <es-list d-source="dataSource" render-item="renderItem(item)"></es-list>
          </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.dataSource = [{
                      id: 1,
                      name: "aaa"
                  },
                  {
                      id: 2,
                      name: "bbb"
                  }]
                  $scope.renderItem = function(item) {
                      return `<es-list-item><span>${item.name}</span></es-list-item>`;
                  }
              });
      </script>
      <script src="../dist/ListItem/ListItem.js"></script>
      <script src="../dist/List/List.js"></script>
  </body>
  
  </html>