title: using setInterval in angularjs factory
body: <p>I was trying the code given in angularjs docs (given here: <a href="http://jsfiddle.net/zGqB8/">http://jsfiddle.net/zGqB8/</a>)
  It just implements a time factory and uses $timeout to update the time object after each second.</p>
  
  <pre><code>angular.module('timeApp', [])
  .factory('time', function($timeout) {
      var time = {};
  
      (function tick () {
          time.now = new Date().toString();
          $timeout(tick, 1000);  // how to do it using setInterval() ?
      })();
  
      return time;
  });
  </code></pre>
  
  <p>How would I do it using setInterval() function instead of $timeout() ?
  I know that one need to use <code>scope.$apply()</code> to enter the angular execution context but how would that work in a factory function? I mean, in a controller, we have a scope, but we don't have scope in a factory function?</p>