Blame view

build/Alert/Alert.js 874 Bytes
3a3ecabe   Imshann   init
1
  import style from "antd/lib/alert/style/index.css";
f886eef1   Imshann   优化Alert、Breadcrumb
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
  import template from "./Alert.html";
  angular.module("esNgAntd").directive("antdAlert", ["esNgAntd", function (esNgAntd) {
    return {
      template: template,
      restrict: "E",
      replace: true,
      transclude: true,
      scope: {
        type: "@",
        message: "@",
        showIcon: "=",
        description: "@"
      },
      controller: function ($scope) {
        $scope.state = {
          icons: {
            warning: "ExclamationCircleFilled",
            success: "CheckCircleFilled",
            info: "InfoCircleFilled",
            error: "CloseCircleFilled"
          }
        };
      },
      link: function ($scope, $element, $attrs, $controllers, $transclude) {
        esNgAntd.createStyle("ant-alert", style);
        esNgAntd.clearAttribute($element[0], ["ng-class", "type", "message", "show-icon", "description"]);
      }
    };
  }]);