title: Pass parameter to Angular ng-include
body: <p>I am trying to display a binary tree of elements, which I go through recursively with ng-include.</p>
  
  <p>What is the difference between <code>ng-init="item = item.left"</code> and <code>ng-repeat="item in item.left"</code> ?
  In this example it behaves exactly the same, but I use similiar code in a project and there it behaves differently. I suppose it's because of Angular scopes.
  Maybe I shouldn't use ng-if, please explain me how to do it better.</p>
  
  <p>The pane.html is:</p>
  
  <pre><code>&lt;div ng-if="!isArray(item.left)"&gt;
      &lt;div ng-repeat="item in [item.left]" ng-include="'Views/pane.html'"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div ng-if="isArray(item.left)"&gt;
      {{item.left[0]}}
  &lt;/div&gt;
  &lt;div ng-if="!isArray(item.right)"&gt;
      &lt;div ng-repeat="item in [item.right]" ng-include="'Views/pane.html'"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div ng-if="isArray(item.right)"&gt;
      {{item.right[0]}}
  &lt;/div&gt;
  
  &lt;div ng-if="!isArray(item.left)"&gt;
      &lt;div ng-init = "item = item.left" ng-include="'Views/pane.html'"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div ng-if="isArray(item.left)"&gt;
      {{item.left[0]}}
  &lt;/div&gt;
  &lt;div ng-if="!isArray(item.right)"&gt;
      &lt;div ng-init="item = item.right" ng-include="'Views/pane.html'"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div ng-if="isArray(item.right)"&gt;
      {{item.right[0]}}
  &lt;/div&gt;
  </code></pre>
  
  <p>The controller is:</p>
  
  <pre><code>var app = angular.module('mycontrollers', []);
  
  app.controller('MainCtrl', function ($scope) {
  
      $scope.tree = {
          left: {
              left: ["leftleft"],
              right: {
                  left: ["leftrightleft"],
                  right: ["leftrightright"]
              }
          },
          right: {
              left: ["rightleft"],
              right: ["rightright"]
          }
      };
  
      $scope.isArray = function (item) {
          return Array.isArray(item);
      }
  });
  </code></pre>
  
  <p>EDIT:
  First I run into the problem that the directive ng-repeat has a greater priority than ng-if. I tried to combine them, which failed. IMO it's strange that ng-repeat dominates ng-if.</p>