timeOut control

Kmandapalli
Posted by Kmandapalli under AngularJS category on | Points: 40 | Views : 215
var AngularController = function ($scope, $timeout) {  

$scope.startCount = 0;
$scope.startTimeout = function () {
$scope.startCount = $scope.startCount + 1;
mytimeout = $timeout($scope.startTimeout, 1000);
}
$scope.startTimeout();

$scope.stopTimeout = function () {
$timeout.cancel(mytimeout);
alert("Timer Stopped");
}
};

Comments or Responses

Login to post response