Firebase establecido por prioridad
Frecuentes
Visto 108 equipos
1
My following piece of code writes a piece of data to firebase using priorities. This is all great and good. However I want to be able to arrange my list in reverse priority order? I understand that FB treats ordering as lowest first and higher further down the list... is there anyway of reversing this?
newMessageRef.setWithPriority({
'message': $scope.place.name + " has been edited",
'updated': $scope.place.updated,
'userid': Auth.signedInAs().id}, $scope.place.updated);
EDIT - I know I can add a custom "reverse" filter to my ng-repeat which does work but you can briefly see the "shuffle" taking place. Would be great to arrange the data at source in the order of most recently added/edited items at the top. Almost the opposite to doing an array style .push()
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas angularjs firebase or haz tu propia pregunta.
You can't reverse the results yet. See este hilo para más detalles - Riron
Hey Nick! Is there some reason you can't just put a
-
in front of the value to reverse them? E.g.5
se convierte en-5
, et al. You can also useendAt().limit(x)
to grab the lastx
records (i.e. the highest prorities). Do either of those help? - Kato@Kato - I tried that and at the time it didn't work. May give it another go :-) - Nick Lewis