title: setInterval function in AngularJS controller is being called automatically
body: <p>I have just started learning angular js. I was going through some tutorials and got a little confused in the following code.</p>
  
  <pre><code>app.controller('MyController', function($scope) {
      $scope.person = { name: "Ari Lerner" };
      var updateClock = function() {
      $scope.clock = new Date();
      };
      var timer = setInterval(function() {
        $scope.$apply(updateClock);
        }, 1000);
      updateClock();
  });    
  </code></pre>
  
  <p>From the execution what I understood is that the setInterval function will call the updateClock function in the interval of 1 sec. But I didn't understand this flow. Since I am not calling this function setInterval anywhere, how is it getting called? All I am doing is using the expression {{ clock }} in my view. 
  Thanks</p>