0
我正在使用Angular 4. HostListener似乎不支持window.onbeforeprint事件处理程序。对于chrome,我能够在HostListener之外为window.matchMedia('print')添加一个侦听器。但是这对IE和Firefox不起作用。什么是window.onbeforeprint工作在角4Angular4打印处理程序
@HostListener('window:onbeforeprint',['$event'])
onBeforePrint(event){
console.log('Before print');
}
https://plnkr.co/edit/4ZdLNklitwsucH0X6Azv