Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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?

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

(window as any).print();

use above line if not using typescript 2.8.2.

about 4 years ago · Santiago Trujillo Report

0

I did just like that

print() {
    // do other stuff...
    window.print();
  }
about 4 years ago · Santiago Trujillo Report

0

In the Template file, you can just use the standard JS EventHandler onclick with window.print() for this, like so:

<button mat-raised-button color="accent" onclick="window.print()">
  <span class="material-icons">print</span> Print
</button>
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!