title: SetTimeout is failing in angular js?
body: <p>I want increment the count for every second. so i am using do while loop but it is crashing the browser.</p>
  
  <p>code:</p>
  
  <pre><code>do{
     $scope.timer = 0;
     console.log($scope.timer);
     setTimeout(function(){
          $scope.$apply(function(){$scope.timer = $scope.timer+1;
          return $scope.timer; });
      }, 1000);
    }while($scope.timer &lt; $scope.level._seconds_per_question);
  </code></pre>
  
  <p>Could any suggest where i am going wrong?</p>