Is there a way that I can arrange a simple array like below:
<div ng-init="fruits=['apple','orange','mango','banana','pineapple','kiwi']">
in ascending order on page load
I tried this, but it dint work:
<ul>
<li ng-repeat="fruit in fruits | orderBy:predicate='fruit'">{{fruit}}</li>
</ul>
I'm sure there must be some pretty simple ways but since I'm a novice in Angular, would like help on this.