import template from "./Row.html";
import style from "antd/lib/grid/style/index.css";
angular.module("esNgAntd").directive("antdRow", function (esNgAntd) {
return {
controllerAs: "antdRow",
restrict: "E",
transclude: true,
replace: true,
scope: {
gutter: "@",
},
template: template,
controller: function ($scope, $element, $attrs) {
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;
}
},
};
});