Last active
October 13, 2015 13:43
-
-
Save katowulf/8eaa39eab05a4d975cd9 to your computer and use it in GitHub Desktop.
Reset method on a $FirebaseArray in AngularFire
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ResetFactory = $FirebaseArray.$extendFactory({ | |
reset: function(itemOrIndex) { | |
var self = this; | |
var key = self.$keyAt(itemOrIndex); | |
self.$inst().$ref().once('value', function(snap) { | |
self.$$updated(snap); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi katowolf,
Great snippets! A small suggestion: could you add the current version of Firebase, AngularFire etc with each snipped. I tried to use this and it failed because Firebase is changing rapidly (which is a good thing).
I was able to modify your code for the current version of Firebase and AngularFire (2.3.1 and 1.1.3). I hope this helps someone: