Execute a callback function periodically in AngularJS.