Skip to content Skip to sidebar Skip to footer

$interval Not Running, Angularjs

I'm not sure why this code isn't running. I'm trying to set up a simple counter that increases every second using angulars $interval wrapper. angular.module('app').controller('tes

Solution 1:

The issue is in on that line

$interval(set_counter(), 1000);

you are calling the "set_counter" right away not passing it to "$interval" as a callback.

Fix:

$interval(set_counter, 1000);

Post a Comment for "$interval Not Running, Angularjs"