wix/angular-tree-control — pull request #5 by danhunsaker (2014-01-26 00:13:23+00:00)
Title: Retain Expanded/Selected Rendering

When a tree model is replaced by a new object, even if that object's contents are identical to the previous value, the entire treecontrol is reloaded from scratch, and since each node has its own scope, the tree appears to forget what has been expanded or selected when the "new" nodes are attached with their new scopes. Additionally, if you expand/select an item, then collapse and re-expand any of its parents, the same symptom applies to the children of the re-expanded node, for the same reason.

This PR fixes both scenarios by first detecting whether a "new" tree model is any different from the previous version, and doing nothing if not, then by using a configurable equality function to determine whether a new node is equivalent to an old one, and applying the old one's expanded/selected status to the new. The default equality function, as indicated in the updated README, first discards any child nodes, then returns the result of `angular.equals()` against the old and new nodes.

Also added tests (and fixed bugs that prevented them from passing on the first attempt) and updated package.json to agree with bower.json on the package version.