Card.js 956 Bytes
import template from "./Card.html";
import style from "antd/lib/card/style/index.css";
angular.module("esNgAntd").directive("antdCard", function (esNgAntd) {
    return {
        controllerAs: "antdCard",
        restrict: "E",
        transclude: true,
        replace: true,
        scope: {
            title: "@",
            extra: "@",
            bordered: "@",
        },
        template: template,
        controller: function ($scope, $element, $attrs) {
            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);
        },
    };
});