JSFiddle - React, Tailwind, and code Playground

HTML

<div ng-app="test" ng-controller='test'>{{value}}</div>

JavaScript

angular.module('test',[],function(){}).controller('test',function($q, $rootScope){
    
    
    function increment(num){
        
        var deferred = $q.defer(), value = 0;
        
        setInterval(function(){
            var incremented = value += num;
            
            $rootScope.$apply(function(){
                deferred.resolve(incremented);
                console.log(incremented);
            });
                
        }, 1000);
        
        return deferred.promise;
        
    }
    
    $rootScope.value = increment(60);
    
    
        
});