Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Limits with AngularFire

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.

like image 369
Robert Maxwell Avatar asked Dec 16 '25 15:12

Robert Maxwell


1 Answers

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", {});
like image 196
Anant Avatar answered Dec 19 '25 06:12

Anant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!