Blame view

build/Card/Card.js 956 Bytes
3a3ecabe   Imshann   init
1
2
  import template from "./Card.html";
  import style from "antd/lib/card/style/index.css";
81f8a467   Imshann   调整组件前缀
3
  angular.module("esNgAntd").directive("antdCard", function (esNgAntd) {
3a3ecabe   Imshann   init
4
      return {
81f8a467   Imshann   调整组件前缀
5
          controllerAs: "antdCard",
3a3ecabe   Imshann   init
6
7
8
9
10
11
12
13
14
          restrict: "E",
          transclude: true,
          replace: true,
          scope: {
              title: "@",
              extra: "@",
              bordered: "@",
          },
          template: template,
81f8a467   Imshann   调整组件前缀
15
          controller: function ($scope, $element, $attrs) {
3a3ecabe   Imshann   init
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
              this.getContext = function () {
                  return $scope;
              };
  
              $scope.state = {
                  extra: $scope.extra,
              };
          },
          link: function ($scope, $element, $attrs, $controllers, $transclude) {
              $element[0].removeAttribute("title");
              $element[0].removeAttribute("extra");
              $element[0].removeAttribute("ng-class");
              esNgAntd.createStyle("ant-card", style);
          },
      };
  });