http://plnkr.co/edit/apwAQG9tczOUckbc9bya?p=preview
https://i.sstatic.net/NcNYh.png
Seeking to rearrange li elements in the plnkr above without using ng-repeat | orderBy:predicate:reverse syntax in the markup.
The challenge is that new items are dynamically loaded into the list based on various sorting criteria, making it impossible to have a static order.
The current structure of my list:
<ul>
<li ng-repeat="t in tags" ng-mouseleave="leaveTag(t)">
<div class="tag-container">
<div class="tag border1"
ng-mouseover="showTagDetails(t)">{{t.name}} | {{t.tweets}}</div>
<tag-details tag="t"></tag-details>
</div>
</li>
</ul>
A button I inserted for sorting within the controller:
<button ng-click="reOrderByTweets()">Order by Tweets</button>
The function I'm working on to implement the ordering logic in the controller:
function reOrderByTweets() {
vs.orderReverse = !vs.orderReverse;
console.log('vs.orderReverse = ', vs.orderReverse);
}