Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/449.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何强制页面等待角度。html2pdf.it不呈现AngularJS_Javascript_Angularjs_Asynchronous_Pdf Generation_Html2pdf - Fatal编程技术网

Javascript 如何强制页面等待角度。html2pdf.it不呈现AngularJS

Javascript 如何强制页面等待角度。html2pdf.it不呈现AngularJS,javascript,angularjs,asynchronous,pdf-generation,html2pdf,Javascript,Angularjs,Asynchronous,Pdf Generation,Html2pdf,我想将HTML页面转换为PDF。似乎是一个很好的工具,因为我可以在自己的服务器上安装它 只需将url添加到路径: 我做了两个简单的页面。一个使用angularjs,另一个只使用JavaScript。在第一个问题上,没有渲染,我看到{{text}。这很奇怪,因为angularjs.org已正确转换为PDF。JS版本也可以工作 如何强制它等待完成? 代码笔 代码笔 PDF格式: PDF JS版本: 代码: 最小角度页面 你好,世界! {{text}} 有棱角的 .module('demoAp

我想将HTML页面转换为PDF。似乎是一个很好的工具,因为我可以在自己的服务器上安装它

只需将url添加到路径:

我做了两个简单的页面。一个使用angularjs,另一个只使用JavaScript。在第一个问题上,没有渲染,我看到
{{text}
。这很奇怪,因为
angularjs.org
已正确转换为PDF。JS版本也可以工作

如何强制它等待完成?

  • 代码笔
  • 代码笔

  • PDF格式:

  • PDF JS版本:
代码:


最小角度页面
你好,世界!
{{text}}

有棱角的 .module('demoApp',[]) .controller('MainCtrl',函数($scope){ $scope.text=“如果您看到这意味着angularjs正在工作”; });
2016年4月8日编辑:

我也不使用异步调用,例如<代码>设置超时()

  • 设置超时版本
  • :

我建议您尝试使用ng绑定html从范围变量呈现html。类似于附加的代码片段。您必须包括angular-sanitize.js,还必须包括一个模块ngSanitize,如代码段中所述


最小角度页面
你好,世界!

有棱角的 .module('demoApp',['ngSanitize'])) .controller('MainCtrl',函数($scope){ $scope.text=“如果您看到这意味着angularjs正在工作”; });
<html lang="en">
<head>
    <title>Minimum AngularJS page</title>
    <meta charset="UTF-8">
</head>
<body ng-app="demoApp">
    <div ng-controller="MainCtrl">
  <h1>Hello World!</h1>
          <p>{{text}}</p>
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
    <script>
        angular
            .module('demoApp', [])
            .controller('MainCtrl', function($scope){
                $scope.text = "If you see this means angularjs is working";
            });
    </script>
</body>
</html>