wix/angular-tree-control — pull request #79 by gempesaw (2014-12-20 16:22:44+00:00)
Title: fixed default ordering when no order-by is supplied

wix/angular-tree-control#15 broke the default ordering of the tree
along with twenty five tests. This fixes all the tests and restores the
ordering in the case that the user does not specify an orderBy
expression - that is, it does not change the tree order at all when
orderBy is not passed in, as one would expect.

Previously, the orderBy filter was blindly applied to the data, even
when the user didn't specify the orderBy attribute on the tree
control. Without this PR, the only way to order the tree is by passing
the orderBy attribute in the element. Programatic tree
ordering was ignored, since the orderBy filter of the directive itself
was always applied last. This is especially problematic since the
orderBy only accepts an expression and not a function, so there's no way
to customize the ordering further than passing in a property of your
nodes. For example, AngularJS's default orderBy is case insensitive, so
we don't have the option of ordering in a case sensitive fashion, unless
we create a completely separate property on the node purely for
ordering.

More importantly, if you did not provide an orderBy, the default orderBy
was being applied, and it did not understand the objects that we usually
use as nodes in our trees. Every user who does not provide an orderBy
will get unexpected ordering where angularJS tries to order objects
naively.