this.applyTemplate(printReq).then(() => {
// Give templates a chance to render before printing
setTimeout(() => {
- this.dispatchPrint(printReq).then(__ => this.reset());
+ this.dispatchPrint(printReq).then(__ => {
+ this.reset();
+ this.printer.printJobQueued$.emit(printReq);
+ });
});
});
});
onPrintRequest$: EventEmitter<PrintRequest>;
+ // Emitted after a print request has been delivered to Hatch or
+ // window.print() has completed. Note window.print() returning
+ // is not necessarily an indication the job has completed.
+ printJobQueued$: EventEmitter<PrintRequest>;
+
constructor(
private locale: LocaleService,
private auth: AuthService,
private store: StoreService
) {
this.onPrintRequest$ = new EventEmitter<PrintRequest>();
+ this.printJobQueued$ = new EventEmitter<PrintRequest>();
}
print(printReq: PrintRequest) {