Blame view

build/Empty/Empty.js 905 Bytes
3a3ecabe   Imshann   init
1
  import template from "./Empty.html";
1b6f912f   Imshann   优化
2
3
  import style from "antd/lib/empty/style/index.css";
  angular.module("esNgAntd").directive("esEmpty", function (esNgAntd) {
3a3ecabe   Imshann   init
4
5
6
7
8
      return {
          controllerAs: "esEmpty",
          restrict: "E",
          transclude: true,
          replace: true,
1b6f912f   Imshann   优化
9
10
11
          scope: {
              image: "@",
          },
3a3ecabe   Imshann   init
12
          template: template,
1b6f912f   Imshann   优化
13
14
15
16
17
18
19
20
21
22
23
24
          controller: function ($scope, $element) {
              this.getContext = function () {
                  return $scope;
              };
  
              $scope.state = {
                  image: $scope.image || "presented_image_default",
              };
          },
          link: function ($scope, $element, $attrs, $controllers, $transclude) {
              esNgAntd.createStyle("ant-empty", style);
          },
3a3ecabe   Imshann   init
25
26
      };
  });
1b6f912f   Imshann   优化
27
28
29
30
31
  
  export default {
      PRESENTED_IMAGE_DEFAULT: "presented_image_default",
      PRESENTED_IMAGE_SIMPLE: "presented_image_simple",
  };