title: AngularJS counter to count up to a target number
body: <p>I'm new to Angular, and would like to implement the same easy function extension in JQuery,
  but use directive (as far as i understand this is how it supposed to be done). </p>
  
  <p>does somone know ready implimentation? </p>
  
  <p>my search ended up only with JQuery solutions and i don't know how to convert it to Angular.</p>
  
  <p>this is what i needed to do: </p>
  
  <p>link to example: <a href="http://jsfiddle.net/YWn9t/" rel="nofollow noreferrer">http://jsfiddle.net/YWn9t/</a></p>
  
  <p>can you help?</p>
  
  <p>function declaration:</p>
  
  <pre><code>$.fn.countTo.defaults = {
      from: 0,  // the number the element should start at
      to: 100,  // the number the element should end at
      speed: 1000,  // how long it should take to count between the target numbers
      refreshInterval: 100,  // how often the element should be updated
      decimals: 0,  // the number of decimal places to show
      onUpdate: null,  // callback method for every time the element is updated,
      onComplete: null,  // callback method for when the element finishes updating
  };
  </code></pre>
  
  <p>how to use:</p>
  
  <pre><code>jQuery(function($) {
          $('.timer').countTo({
              from: 50,
              to: 2500,
              speed: 5000,
              refreshInterval: 50,
              onComplete: function(value) {
                  console.debug(this);
              }
          });
      });
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;span class="timer"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>taken from: <a href="https://stackoverflow.com/questions/2540277/jquery-counter-to-count-up-to-a-target-number">stackoverflow</a></p>