I have a download of a PDF document, currently there are times that it takes to make the request and I do not know how to see what state the request is in to show a loading message.
function downloadPDF () {
$log.debug('btn descargar PDF');
var url = Constants.BaseURLBack + '/mir/reportes/matriz?idMir=' + idMir;
RestService.getFile(url,'application/pdf')
.then(function(response) {
var blob = new Blob([response.data], { type: "application/pdf" });
saveAs(blob, "matriz.pdf");
})
.catch(function(err){
message("error","Excel sin datos","Por favor seleccione un proyecto con datos");
console.log("Error al descargar el excel", err);
});
}