In the following snippet, the progress call is getting triggered continuously with out the 10s delay. Please let me know where i am going wrong
ctrl.progress =function (fileName){
if(ctrl.status < 100){
ctrl.timer = $timeout(function(fileName){
LookUpValueService.getImportStatus(fileName).
then(function(value){
ctrl.status = value;
ctrl.progress(fileName);
});
//ctrl.status = ctrl.status + 1;
}(fileName),5000);
}
else{
$timeout.cancel(ctrl.timer);
}
}; ctrl.progress("test.txt");