What i am trying to do is to open partial view in new window and call print function, but problem is that partial view is render after print function so i allways get blank page. I tried with $timeout function but i get same result. Is it possible to do this somehow without using something like this:
$scope.print = function () {
setTimeout(function () { print()}, 1000);
}
I want to avoid delay in this way
EDIT: this is how i use now but i dont like it :
$scope.ConfirmTicketPayOut = function (ticketPin, username) {
$scope.ticketPin = ticketPin;
localStorage.setItem("pin", ticketPin);
accountDataProviderService.confirmTicketPayOut(ticketPin, username)
.then(function (response) {
$scope.confirmTicketPayOut = response;
if ($scope.confirmTicketPayOut.Result == true) {
$window.open('/print');
}
});
localStorage.clear();
}
$scope.print = function () {
setTimeout(function () { print()}, 1000);
}