Alert.js 839 Bytes
import style from "antd/lib/alert/style/index.css";
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, $element) {
      $scope.state = {
        icons: {
          warning: "ExclamationCircleFilled",
          success: "CheckCircleFilled",
          info: "InfoCircleFilled",
          error: "CloseCircleFilled"
        }
      };
    },
    link: function ($scope) {
      esNgAntd.createStyle("ant-alert", style);
      esNgAntd.clearAttribute($element[0], ["ng-class", "type", "message", "show-icon", "description"]);
    }
  };
}]);