I am new to angularjs
. I am using progress-bar
. So, Here
I have a upload functionality where user can upload many files.In that to show progress I am using the progressBar
. So, My code for the progress bar is like -
<uib-progressbar
class="progress-striped active"
ng-show="folderProcessing && !isSingleFile"
animate="true" max="100"
value="progressValuePercentage"
type="success">
<i>
<span>
{{progressValuePercentage}} / 100
</span>
</i>
So here In controller ,
if (($rootScope.progressValue !== $rootScope.totalFiles)) {
$rootScope.folderProcessing = true;
$rootScope.progressValue = $rootScope.progressValue + 1;
$rootScope.progressValuePercentage = (($rootScope.progressValue * 100) / $rootScope.totalFiles).toFixed(2);
if ($scope.progressValue === $rootScope.totalFiles) {
$rootScope.progressValue = 0;
$rootScope.progressValuePercentage = 0;
}
}
Now
if (docType === AppConstants.docType.RESUME) {
if(res.isProcessedSuccessfully) {
toastr.success(AppConstants.fileProcessSuccessMessage, 'File processed successfully');
} else {
toastr.error(res.documentId, 'File Processing Failed');
}
} else {
$rootScope.folderProcessing = false;
toastr.success(AppConstants.jobDescriptionSuccessMessage, 'File processed successfully');
$scope.hideProcessSpinner = true;
}
Now when there is an error like toaster.error then if 50% is completed then after that if error is there then it should take the next portion in red
colour and the if next one processed successfully then should fill the portion in green
its original colour. How can I achieve this ? Can any one help me with this ?