title: How to call scope function with data from ng-repeat?
body: <p>How to call controller function automatically in each ng-repeat? Can I use for it directive?</p>
  
  <p>Angular view:</p>
  
  <pre><code>&lt;div ng-controller="Grid"&gt;
      &lt;div class="row" data-ng-repeat="row in rows"&gt;
          &lt;div class="col" data-ng-repeat="col in row.col"&gt;
              &lt;div dnd-list="column.elements"&gt;
                  &lt;div ng-repeat="item in column.elements" ng-include="test.html"&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script type="text/ng-template" id="test.html'"&gt;
    &lt;div style:"display: none;"&gt;{{item.grid_id = column.grid_id}}&lt;/div&gt;
    &lt;div style:"display: none;"&gt;{{item.position = $index}}&lt;/div&gt;
    &lt;-- {{addItemToArrayAndReorderGridEl(item, column, $index)}} --&gt;
    &lt;-- &lt;div ng-model="addItemToArrayAndReorderGridEl(item, column, $index)" &gt;&lt;/div&gt; --&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>Controller snippet:</p>
  
  <pre><code>$scope.items = [];
  $scope.addItemToArrayAndReorderGridEl = function (item, column, position) {
    if ($scope.action_type === "edit") {
      $scope.items.push(item);
    }
    console.log($scope.items);
  };
  </code></pre>