Adding track by $index and removing lambda func.

This commit is contained in:
Simon Kers 2015-04-21 15:56:23 +02:00 committed by Martin Schröder
parent b9b6c42023
commit 2f04d960c3
2 changed files with 2 additions and 2 deletions

View file

@ -55,7 +55,7 @@ angular.module("luci")
Object.assign(o.children, children);
item = o;
}
obj.children_list = Object.keys(obj.children).map(key => obj.children[key]);
obj.children_list = Object.keys(obj.children).map(function(key) { obj.children[key]; });
obj.children_list.sort(function(a, b){
return a.index - b.index;
});

View file

@ -14,7 +14,7 @@
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav" auto-active>
<li class="dropdown" ng-repeat="item in tree.children_list">
<li class="dropdown" ng-repeat="item in tree.children_list track by $index">
<a href="#!{{item.path}}" role="button" >{{item.text | translate}} </a>
<!--<a href="#!{{item.path}}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{item.text | translate}} <span class="caret"></a>
<ul class="dropdown-menu" role="menu">