title: Have ngRepeat stop after one cycle, using in directive
body: <p>I am trying to get some more information about the van, by using its id to call the fleet that it is attached to. My code works right now when I return information about the van. But when I un-comment the commented lines of the code it breaks, and gives me this error <a href="https://docs.angularjs.org/error/" rel="nofollow">https://docs.angularjs.org/error/</a>$rootScope/infdig?p0=10&amp;p1=%5B%5D</p>
  
  <p>Why is it that I can't call a service, I don't understand why that breaks it, or how to fix it. </p>
  
  <p>Directives.directive('displayCurrentVans', ['Van', 'Fleet', function(Van, Fleet) {</p>
  
  <pre><code>var render =   '&lt;div class="row"&gt;' +
      '&lt;div class="col-lg-12"&gt;' +
          '&lt;div class="alert alert-info alert-bottom-trimmer"&gt;' +
              '&lt;table class="table table-hover table-condensed table-responsive text-center"&gt;' +
                  '&lt;thead ng-click="renderVans()" class="cursor"&gt;' +
                      '&lt;tr&gt;' +
                          '&lt;th class="text-center"&gt;Van&lt;/th&gt;' +
                          '&lt;th class="text-center"&gt;Radio&lt;/th&gt;' +
                          '&lt;th class="text-center"&gt;User&lt;/th&gt;' +
                      '&lt;/tr&gt;' +
                  '&lt;/thead&gt;' +
                  '&lt;tbody ng-show="vanbox" ng-repeat="van in vans | limitTo: 4"&gt;' +
                      '&lt;tr&gt;' +
                          '&lt;td&gt;{{getVan(van)}}&lt;/td&gt;' +
                          '&lt;td&gt;{{van.radio}}&lt;/td&gt;' +
                          '&lt;td&gt;{{van.user_id}}&lt;/td&gt;' +
                     '&lt;/tr&gt;' +
                  '&lt;/tbody&gt;' +
              '&lt;/table&gt;' +
          '&lt;/div&gt;' +
      '&lt;/div&gt;' +
  '&lt;/div&gt;';
  
  return {
      scope: true,
      compile: function(tElem, atts){
          tElem.append(render);
          return function(scope, elem, attrs){
              scope.vans = Van.GetVans();
              scope.fleet = Fleet.GetFleets();
  
               console.log(Fleet.GetFleet({id: '1'}));
  
              scope.vanbox = false;
              scope.renderVans = function(){
                  console.log("hello");
                  scope.vanbox = !scope.vanbox;
              }
              scope.getVan = function(van){
                console.log("hi");
                return van.id
                //var number = Fleet.GetFleet({id: van});
                //return number.ident;
              }
          }
      }
  }
  </code></pre>
  
  <p>}]);</p>