Is there a way to dynamically update the DOM without utilizing ng-repeat in your template? It appears that when using ng-repeat to load a list of objects, any additions or deletions from the database automatically reflect in the DOM. However, if I simply use $scope outside of an ng-repeat, the updates do not happen dynamically.
I'm working on code that displays the number of users online from Firebase. A console.log statement shows whenever a user logs in, but the scope does not update. Is there a method to refresh this information in the DOM to display the updated count?
Example code provided below:
firebase.database().ref('presence').on('value', function(snap) {
console.log("# of online users = " + snap.numChildren());
$scope.usersOnline = snap.numChildren();
});