Within the Angular7/Pug application, there was previously a file download link implemented in table.component.pug like this:
div
p File to download:
a([href]="downloadLink", download="table.xlsx")
some-icon
span some-text
Now, I am looking to make a change. Instead of a static file, I want users to be able to download a file returned from a function located in table.component.ts:
getTable(): Observable<any> {
return this.service.getTable();
}
How should I modify the div in pug? I attempted something like:
div
p MS Excel table:
input((click)='getDownload()')
some-icon
span some-text
However, as a backend developer, the above code is not working for me :-) Please provide guidance on how to achieve this functionality.