There is A html template in my Angular2 component. What i want to do is, When I click on print button That is in same html page, it should perform the print function(like- displaying print preview, Proceed and print, etc). So, Can Anyone You tell me how to print an html template in Angular2?
Asked
Active
Viewed 1,215 times
-2
-
There is not Angular2 specific printing approach for this, you can simply use JavaScript: `window.print()`. – Tudor Ciotlos Nov 25 '16 at 08:01
-
thank you :). But, window.print() isn't working. It just prints a part of my HTML template. I wanna print the whole template.:( – Nobody Dec 16 '16 at 09:56
-
check this http://stackoverflow.com/questions/41379274/print-html-template-in-angular-2-ng-print-in-angular-2/41379912#41379912 – suuuunto Feb 26 '17 at 08:42