【发布时间】:2015-07-13 20:58:24
【问题描述】:
我有这部分代码,主要想法是在新页面中打开部分视图并为该部分视图调用打印函数。我能做的是打开新窗口并调用打印功能,但我没有成功渲染部分视图......所以我的打印功能是空白的。有人可以帮我怎么做吗?
$scope.ConfirmTicketPayOut = function (ticketPin, username) {
$scope.pinTicket = ticketPin;
localStorage.setItem("pin", ticketPin);
accountDataProviderService.confirmTicketPayOut(ticketPin, username)
.then(function (response) {
$scope.confirmTicketPayOut = response;
if ($scope.confirmTicketPayOut.Result == true) {
var w = $window.open('/print');
angular.element(w).ready('load', function () {
w.print();
});
}
});
}
我试过这个:$timeout(w.print(),0); 但没有成功
【问题讨论】:
标签: angularjs