My dynamic data isn't updating in header tag. It loads properly the first time but doesn't catch any updates. I have a scope variable that changes from firebase, it console logs the updates but my h1 tag doesnt update. Anybody know whats wrong? Im new to angular and may be using wrong directive? Thank you. Heres my code
//HTML
<div ng-model="len">
<h2 id="timednum">
<span>{{ len }}</span>
</h2>
</div>
//js
var firebaseRef = new Firebase("https://myApp.firebaseio.com/data");
firebaseRef.on('value', function(dataSnapshot){
var tableLength = dataSnapshot.val().data;
$scope.len = tableLength;
$scope.$apply(); //SOLUTION!!!!
console.log("this updates properly" + $scope.len);
})
});
I got the solution, Thanks guys... FOr anybody else struggling checkout the solution or the links in the comments