Skip to content

Instantly share code, notes, and snippets.

@phsacramento
Last active December 12, 2016 10:41
Show Gist options
  • Save phsacramento/0789661257fbd5170525a690bf6ecb3a to your computer and use it in GitHub Desktop.
Save phsacramento/0789661257fbd5170525a690bf6ecb3a to your computer and use it in GitHub Desktop.
Firebase counter increment
var vm = this;
var databaseColumn = firebase.database().ref('database');
vm.count = 0;
databaseColumn.on('value', function(snapshot) {
snapshot.forEach(function() {
$scope.count++;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment