type="button"
id="exportJson"
(click)="exportJson()">Export</button>
-<button class="button"
- type="button"
- [disabled]="downloadJsonHref === ''"
- id="downloadJson">
- <a [href]="downloadJsonHref"
- [hidden]="downloadJsonHref === ''"
- download="speisekarte.json">Download</a></button>
+<a [href]="downloadJsonHref"
+ id="exportLink"
+ hidden="hidden"
+ download="speisekarte.json">Download</a>
<button class="button main"
type="button"
let uri = this.sanitizer.bypassSecurityTrustUrl(
"data:text/json;charset=UTF-8," + json);
this.downloadJsonHref = uri;
+ let element = document.getElementById("exportLink");
+ element?.click();
}
public fileEvent(event: any): void