Answer the question
In order to leave comments, you need to log in
How to display POST completion percentage in Angular 1.x?
Hello everyone, you need to display the progress bar with the percentage of the POST request completed. In the request, I pass the name of the template and the file extension, then the server generates it and returns it. Actually, while the generation process is going on, we need a progress bar.
I try like this
$http({
method: 'POST',
url: config.apiUrl + "/RevDoc/GenerateDocument",
data: model,
eventHandlers: {
progress: function (e) {
console.log(e);
if (e.lengthComputable) {
progress = Math.round(e.loaded * 100 / e.total);
console.log("progress: " + progress + "%");
if (e.loaded = e.total) {
console.log("File upload finished!");
}
}
}
},
}).then((response) => {
console.log(response);
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question