使用带有AngularFire限制AngularFire

2023-09-13 03:28:09 作者:点烟抽寂寞

这是code我现在:

 var url = 'https://*****.firebaseio.com/photos';
var promise = angularFire(url, $scope, 'photos', {});

promise.then(function() {

    //limit here.

});

C $ C可我插入什么$来限制从火力返回只有那些有指定的优先级(比方说,当务之急是新)?

What code can I insert to limit what is returned from the firebase to only those have a specified priority (let's say the priority is "new)?

感谢您的帮助。

推荐答案

只是传递一个已经有限的查询angularFire,像这样:

Just pass in an already limited query to angularFire, like so:

var ref = new Firebase("https://*****.firebaseio.com/photos");
var promise = angularFire(ref.startAt("new"), $scope, "photos", {});