I have a enum defined in Typescript:
enum PriorityLevel {
High = <any>'High',
Normal = <any>'Normal',
Low = <any>'Low'}
Then in my html I have:
<button id= "assignmentBtn" type="button" ng-repeat="item in list.getItems()" class="btn" ng-class="list.getcolor(item)">
{{item.description}}
</button>
Where each item has a PriorityLevel.
My question is that I want to sort this list by PriorityLevel, so that High is on top, then Normal and then Low. I tried to add
ng-repeat="item in list.getItems() | orderBy:'priority'"
But obviously, this orders the items alpabetically.
I quess I have to make a custom orderby function, but can anyone help me with how that should look in my case?