Using Limits with AngularFire

痴心易碎 提交于 2019-12-07 18:16:14

问题


This is the code I have right now:

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

promise.then(function() {

    //limit here.

});

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)?

Thanks for the help.


回答1:


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", {});


来源:https://stackoverflow.com/questions/17179532/using-limits-with-angularfire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!