Pregunta

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.

¿Fue útil?

Solución

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", {});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top