AngularJS - rangy import - 此环境不支持Rangy。原因:未找到身体元素

时间:2017-06-15 18:07:59

标签: angularjs rangy

我将使用此内联文本编辑器

AngularJS inline text editor

因此我加入了以下javascript:

<script type="text/javascript" src='assets/bower_components/angular-text/dist/rangy-core.js'></script>
    <script type="text/javascript" src='assets/bower_components/angular-text/dist/rangy-selectionsaverestore.js'></script>
    <script type="text/javascript" src='assets/bower_components/angular-text/dist/rangy-classapplier.js'></script>
    <script type="text/javascript" src='assets/bower_components/angular-text/dist/ite.js'></script>

在head标签的index.html中,但我得到以下浏览器控制台输出:

Rangy is not supported in this environment. Reason: No body element found

有谁知道为什么?

[编辑] 问题是,在rangy-core中可以访问body,但是body仍然是null:

var body = getBody(document);
    if (!body || body.nodeName.toLowerCase() != "body") {
        fail("No body element found");
        return;
    }

我已将javascript文件包含在标记中,并且我还尝试将其包含在body标记内但没有成功。

0 个答案:

没有答案