Order List Dividers Based on Custom OrderBy Function

Please see the CodePen below for clarification. I have a situation where I need to order the list dividers based on a “ParentId” field that is in each child of the parent. I have an array of ParentId’s which specified the order that the parent items should appear in the list. How might I go about this? If you notice, I am losing the original order of my list dividers when using ng-repeat-start.

See the Pen Nested List: 1.0.0-beta.8 by Josh (@jpmckearin) on CodePen.

Sort the list properly and then set the items array as I did in my example, dont use a hash, use a real array and you should be fine