I'm trying to download a file using an ANGULAR based app, but the file which can be read by HTML 5 are shown in the browser instead of being downloaded. Most of the provided solution online are related to HTML/PHP programming, but they are not helpful in the case of ANGULAR. The code which I'm using is as following:
html:
<button (click)="download()">Download!</button>
typescript:
download(){
window.open('http://localhost/test/uploads/file.mp4');
}
Any suggestions? Thanks in advance.