javascript - ng-repeat recursive loop crashes the browser -
okay have following directive:
app.directive("menuitem", function() { return { restrict : "e", templateurl: 'tpl/directives/menu-item.html', scope: { category: '=' }, link: function(scope,element, attr){ } }; });
this being called such:
top level
<!-- list --> <ul class="nav" ng-controller="navcontroller"> <menu-item ng-repeat="category in categories" category="category"></menu-item> </ul> <!-- / list -->
menu-item.html
<li> <a href="" class="auto" ng-if="category.subcategories.length > 0"> <span class="pull-right text-muted"> <i class="fa fa-fw fa-angle-right text"></i> <i class="fa fa-fw fa-angle-down text-active"></i> </span> <span>{{category.name}}</span> </a> <a ui-sref="app.ui.googlemap" href="#/app/ui/googlemap" ng-if="category.subcategories.length <= 0"> <span>{{category.name}}</span> </a> <ul class="nav dker" ng-if="category.subcategories.length > 0"> <menu-item ng-repeat="cat in category.subcategories" category="cat"></menu-item> </ul> </li>
there no console errors basicly crashes before can console up.
can tell me how fix this?
Comments
Post a Comment