Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 - What is window.print in typescript

In javascript I could do:

window.print()

To bring up a printer dialog box, but how do you do this in typescript?

like image 485
Andrew Junior Howard Avatar asked Apr 03 '17 15:04

Andrew Junior Howard


2 Answers

I did just like that

print() {
    // do other stuff...
    window.print();
  }
like image 190
Gandarez Avatar answered Sep 16 '22 14:09

Gandarez


(window as any).print();

use above line if not using typescript 2.8.2.

like image 34
Prashant Avatar answered Sep 19 '22 14:09

Prashant