Blame view

build/Row/Row.js 965 Bytes
3a3ecabe   Imshann   init
1
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
31
32
  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;
              }
          },
      };
  });