如下面代码所示:
1 $scope.printReport = function () { 2 var newHtml = $scope.chartContent; 3 var frameContainer =window.document.getElementById("printContainer"); 4 frameContainer.contentDocument.body.innerHTML = [‘<html>‘, newHtml, ‘</html>‘].join(‘‘);; 5 frameContainer.contentDocument.execCommand("Print"); 6 return false; 7 };
时间: 2024-10-16 21:15:18