I would like to update my template before print it.
So I have used this event: @HostListener("window:beforeprint", ["$event"])
But the template is updated too late; after closing the print window.
I have tried the matchMedia
event but same.
I also tried to use NgZone
but without success.
You can test here: https://stackblitz.com/edit/angular-window-before-print-event
/!\ The Stackblitz console is not the right. You need to open the DevTool console to see the right message at the right time
Do you have any suggestion ? Thanks for your help !