I would like to print a part of my page.
Actually, i try, to call another page with my part only and print this.
But the print result isn't the view result. My print result doesn't render angular binding.
My MainView
<div id="main-content" ng-controller="ConsulterSectionController">
<ng-include src="'app/plugins/pilotage/views/templates/_section.html'" ng-init="initParams()" />
</div>
My call to print
printSection = (divName) => {
var temp = new Array();
temp[0] = this.$scope.model;
temp[1]=this.$scope.elementsColonne1;
temp[2]=this.$scope.elementsColonne2;
temp[3] = this.$scope.estOuvert;
var json = JSON.stringify(temp);
sessionStorage.setItem("sectionPrint", json);
var popupWin = this.$window.open('/Efficience/printEcran.html', 'Imprime Ecran', 'width=1000,height=1000');
this.$timeout(function () { console.log('6'); popupWin.document.close();}, 2000, true);
}
Here is my screen view http://hpics.li/ac5744d
Here is my print view http://hpics.li/95436c8
I try this : Print a div using javascript in angularJS single page application, but angular attributs aren't interpret.
Do you have any idea to print my view binding?
EDIT : 18/06
If i replace
this.$timeout(function () { popupWin.document.close();}, 2000, true);
}
by
setTimeout(function () { popupWin.document.close();}, 0);
it's work only for chrome but i need to work with ie11