AngularFire used to have a orderByPriority filter

后端 未结 1 326
逝去的感伤
逝去的感伤 2021-01-24 21:59

From Google result it looks like AngularFire used to have a orderByPriority filter. But I cannot find this in the current AngularFire api docs: https://www.firebase.com/docs/web

相关标签:
1条回答
  • 2021-01-24 22:48

    There is no longer a need for orderByPriority since you can utilize a synchronized array, which is already implicitly ordered.

    So in ancient days, you would do something like:

    $scope.data = $firebase(ref);
    
    <div ng-repeat="item in data | orderByPriority" />
    

    In not so ancient times (i.e. 0.8.x or greater) you would simply choose an array format:

    $scope.data = $firebase(ref).$asArray();
    
    <div ng-repeat="item in data" />
    
    0 讨论(0)
提交回复
热议问题