AngularFire 曾经有一个 orderByPriority 过滤器

编程入门 行业动态 更新时间:2024-10-27 13:33:17
本文介绍了AngularFire 曾经有一个 orderByPriority 过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

从 Google 的结果来看,AngularFire 过去似乎有一个 orderByPriority 过滤器.但我在当前的 AngularFire api 文档中找不到这个:https://www.firebase/docs/web/libraries/angular/api.html.据我了解,orderByPriority 将对象属性转换为数组.我想这个过滤器已经消失了,因为现在有另一种更好的方法来做,但那个方法是什么?

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/docs/web/libraries/angular/api.html. As I understand it, orderByPriority converted an objects properties into to an array. I guess this filter is gone because there is another and better way to do it now, but what is that method?

推荐答案

不再需要 orderByPriority,因为您可以使用已经隐式排序的同步数组.

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" />

在不那么古老的时代(即 0.8.x 或更高版本),您只需选择一种数组格式:

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" />

这篇关于AngularFire 曾经有一个 orderByPriority 过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-22 11:24:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1023088.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:过滤器   有一个   AngularFire   orderByPriority

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!