Skip to content

Commit

Permalink
Revert addition of "track by $index" expression in ng-repeat. It caus…
Browse files Browse the repository at this point in the history
…es a bug: Angular does not render the children nodes when the tree source data is changed by another one.
  • Loading branch information
christophercr committed May 29, 2016
1 parent 6d09418 commit 52d161f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/scripts/directives/ivh-treeview-children.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ angular.module('ivh.treeview').directive('ivhTreeviewChildren', function() {
require: '^ivhTreeviewNode',
template: [
'<ul ng-if="getChildren().length" class="ivh-treeview">',
'<li ng-repeat="child in getChildren() track by $index"',
'<li ng-repeat="child in getChildren()"',
'ng-hide="trvw.hasFilter() && !trvw.isVisible(child)"',
'class="ivh-treeview-node"',
'ng-class="{\'ivh-treeview-node-collapsed\': !trvw.isExpanded(child) && !trvw.isLeaf(child)}"',
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/directives/ivh-treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ angular.module('ivh.treeview').directive('ivhTreeview', ['ivhTreeviewMgr', funct
},
template: [
'<ul class="ivh-treeview">',
'<li ng-repeat="child in (trvw.root | ivhTreeviewAsArray) track by $index"',
'<li ng-repeat="child in trvw.root | ivhTreeviewAsArray"',
'ng-hide="trvw.hasFilter() && !trvw.isVisible(child)"',
'class="ivh-treeview-node"',
'ng-class="{\'ivh-treeview-node-collapsed\': !trvw.isExpanded(child) && !trvw.isLeaf(child)}"',
Expand Down

0 comments on commit 52d161f

Please sign in to comment.