I have a controller in which a value gets randomly generated
app.controller('detailReadingCtrl',function(){
var value = 0;
$scope.dispValue = 0;
setInterval(function(){
value = Math.floor(Math.random()*1000);
$scope.dispValue = value;
}
});
and my html is
<div>{{dispValue}}</div>
The Value on the html is not getting updated with the changed value. The dispvalue is changing in the controller but it is not updating in the html. I want to see the value change for every second on the screen without the need of refresh.
I tried using $scope.$watch and also $scope.$broadcast both seem to not work. Please let me know if you have any ideas about this.