Skip to main content

Posts

Showing posts with the label AngularJS Print Directive of html templates

AngularJS Print Directive of html templates

Hello everyone, Today's I am going to share an interesting article somebody asked to me in my forum,  Is there an Angular way of printing a div section from a HTML page? I was say to him yes but I don't want how, now I study about it and going to share the detail about the  PRINT to inner  html  templates  using Angular. AngularJs code sample: //This is print method $scope . printTo = function (printSectionId) { var innerContents = document . getElementById (printSectionId).innerHTML; var popupWinindow = window . open ( '' , '_blank' , 'width=600,height=700,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no' ); popupWinindow. document . open (); popupWinindow. document . write ( '<html><head><link rel="stylesheet" type="text/css" href="style.css" /></head><body onload="window.print()">' + innerContents + '</html>' ); popupWi...