Row.js 965 Bytes
import template from "./Row.html";
import style from "antd/lib/grid/style/index.css";
angular.module("esNgAntd").directive("esRow", function (esNgAntd) {
    return {
        controllerAs: "esRow",
        restrict: "E",
        transclude: true,
        replace: true,
        scope: {
            gutter: "@",
        },
        template: template,
        controller: function ($scope, $element) {
            this.getContext = function () {
                return $scope;
            };

            $scope.state = {
                gutterHalf: null,
            };
        },
        link: function ($scope, $element, $attrs, $controllers, $transclude) {
            esNgAntd.createStyle("ant-grid", style);
            $element[0].removeAttribute("ng-style");
            $element[0].removeAttribute("ng-transclude");

            if ($scope.gutter) {
                $scope.state.gutterHalf = parseInt($scope.gutter) / 2;
            }
        },
    };
});