【发布时间】:2017-03-10 17:12:52
【问题描述】:
我正在尝试在我的 angular2 项目中使用 html2canvas,我将创建一个元素并将画布附加到正文,如下所述:
let newDiv = document.createElement("div");
let newContent = document.createTextNode("Hi there and greetings!");
newDiv.appendChild(newContent);
html2canvas(newDiv).then(function(canvas) {
document.body.appendChild(canvas);
});
但我收到以下错误:
异常:未捕获(承诺中):TypeError:无法读取属性 null TypeError 的“removeAttribute”:无法读取属性 'removeAttribute' of null
有什么办法解决这个错误吗?
谢谢,
【问题讨论】:
标签: angular html2canvas