I'm trying to print a div
that has been rendered using Angular. I'm using this answer as a starting point https://stackoverflow.com/a/30765875/285190, with the print function being pretty simple
$scope.printIt = function(){
var table = document.getElementById('printArea').innerHTML;
var myWindow = $window.open('', '', 'width=800, height=600');
myWindow.document.write(table);
myWindow.print();
};
The problem is the innerHTML
contains all the items that would exist if the ng-show
ng-hide
directives hadn't been executed.
Is there a way to get the actual HTML the client is seeing, i.e. after Angular has performed its magic?