Hello, I've looked all over and haven't found anything on this.

Is it possible to batch remove items from a firebase array using .$remove?

I'm currently working on an app with a chat function in which I'd like to
automatically delete chat messages once the chat message list becomes a
certain length.

Ideally, I'd do it like this (if, for example, I wanted the messages list
only 5 messages long):

if ($scope.messages.length > 5) {
   $scope.messages.$remove($scope.messages.length - 5, $scope.messages.length

Please help! I've tried everything...

You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/74c24173-ca53-4d65-a63c-c4ec80198606%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupfirebase-angular @
postedSep 2, '15 at 3:26a
activeSep 2, '15 at 5:31a

2 users in discussion

Jacob Wenger: 1 post Derek Sifford: 1 post



site design / logo © 2021 Grokbase