I have a single page web application using angularJS. I need to print a div of certain page. I tried the following:
The page contains few div (print.html)
$scope.printDiv = function(divName) { var printContents = document.getElementById(divName).innerHTML; var popupWin = window.open('', '_blank', 'width=300,height=300'); popupWin.document.open(); popupWin.document.write('' + printContents + ''); popupWin.document.close(); }