Blame view

build/Icon/Icon.js 656 Bytes
3a3ecabe   Imshann   init
1
  import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpers";
f886eef1   Imshann   优化Alert、Breadcrumb
2
3
4
5
6
7
8
9
10
11
  import * as iconsSvg from "@ant-design/icons-svg";
  angular.module("esNgAntd").directive("antdIcon", ["$compile", function ($compile) {
    return {
      template: `<span class="anticon"></span>`,
      restrict: "E",
      replace: true,
      transclude: true,
      scope: {
        type: "@"
      },
29558aa1   Imshann   优化
12
      link: function ($scope) {
f886eef1   Imshann   优化Alert、Breadcrumb
13
14
15
16
17
18
19
20
21
22
23
        let template = renderIconDefinitionToSVGElement(iconsSvg[$scope.type], {
          extraSVGAttrs: {
            width: "1em",
            height: "1em",
            fill: "currentColor"
          }
        });
        $element.append(template);
      }
    };
  }]);