У меня есть html-файл, где я вызываю этот файл index.html
<div id="printarea">
<table class="printclass">
something to print
</table>
<button ng-click="printDiv('printarea');">Print div</button>
</div>
.js:
.controller('myController', ['$scope','$http', '$filter', '$q', function($scope, $http,$filter,$q){
$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('<html><head><link rel="stylesheet" type="text/css" href="css/custom.css" /></head><body onload="window.print()">' + printContents + '</body></html>');
popupWin.document.close();
}
Ничего не происходит, когда я нажимаю кнопку. Я новичок в angularjs, может кто-нибудь помочь, пожалуйста. Обратите внимание, что мой CSS находится в указанной папке.