Angularjs $interval function to execute code repeatedly example