var newWin = window.open('about:blank');
newWin.onload = () =>{
alert();
newWin.focus();
newWin.print();
};
let promise = $http.get(myUrl).then(function (res) {
newWin.document.write(res.data);
return true;
});
var newWin = window.open('about:blank');
let promise = $http.get(myUrl).then(function (res) {
newWin.document.write(res.data);
var count = newWin.document.querySelectorAll('img').length;
newWin.document.querySelectorAll('img').forEach(function (el) {
el.onload = function () {
if(!--count){
newWin.focus();
newWin.print();
}
};
});
return true;
});