I've been working on a code to display a random number in my view, but I keep encountering the following error message:
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
It seems to be related to a digest outflow issue, and I'm unsure of how to troubleshoot it. Here's what I currently have:
HTML
<p>{{getRandomNumber(2, 12)}} providers nearby</p>
controller.js
.controller('ServicesCtrl', function($scope, ServicesData, $stateParams) {
$scope.getRandomNumber = function(min, max){
return Math.floor(Math.random() * (max - min) + min);
}
});