i used this code for pause timer:
when using $timeout in angularjs how to implement pause and resume functionality
$scope.pause = function(){
window.clearTimeout(t);
}
timedcounter = function () {
time = time + 1;
localStorage.autotimertime = time;
t = $timeout(timedcounter, 1000);
display(time);
}