title: time countdown using angular js
body: <p>I am new angular js. I am trying to make countdown using angular js .My code is </p>
  
  <pre><code>$scope.endingdays = function(datevalue){
      var endingin=new Date(datevalue);
      var date1=new Date();
      var date1_ms = Math.round(date1.getTime());
      var date2_ms = Math.round(endingin.getTime());
      var miliseconds = date2_ms - date1_ms;
      var second = miliseconds / 1000 ;
      var seconds = Math.floor(second) %60;
      var minutes =  Math.floor(second/60) % 60;
      var hours = Math.floor(second/3600);    
      result = hours&lt;10 ? '0'+hours+':' : hours+':';      
      result += minutes&lt;10 ? '0'+minutes+':' : minutes+':';
      result += seconds&lt;10 ? '0'+seconds : seconds;
      return result;
  };
  </code></pre>
  
  <p>This is my new code here every thing is fine except countdown.how i make countdown automatically ?.Now it showing countdown when reload page.
  My print code</p>
  
  <pre><code>{{endingdays(deal.endDate)}}
  </code></pre>
  
  <p>I am using angular js 1.2.23 </p>