简单的TinyMce抛出" o不是构造函数"和"属性onload of null"

时间:2017-01-12 16:05:38

标签: javascript angularjs tinymce tinymce-4 angular-ui-tinymce

继TutsMce之后,它会让我在使用Tinymce加载网站时抛出 Uncaught TypeError: o is not a constructor
换到其他网站会抛出 TypeError: Cannot set property 'onload' of null
重定向到错误的位置

function et() {
    var e = !0
      , n = this;
    this.debugEnabled = function(n) {
        return y(n) ? (e = n,
        this) : e
    }
    ,
    this.$get = ["$window", function(t) {
        function l(e) {
            return e instanceof Error && (e.stack ? e = e.message && e.stack.indexOf(e.message) === -1 ? "Error: " + e.message + "\n" + e.stack : e.stack : e.sourceURL && (e = e.message + "\n" + e.sourceURL + ":" + e.line)),
            e
        }
        function i(e) {
            var n = t.console || {}
              , i = n[e] || n.log || p
              , o = !1;
            try {
                o = !!i.apply
            } catch (e) {}
            return o ? function() {
                var e = [];
                return r(arguments, function(n) {
                    e.push(l(n))
                }),
                i.apply(n, e)// Errors here
            }
            : function(e, n) {
                i(e, null == n ? "" : n)
            }
        }
        return {
            log: i("log"),
            info: i("info"),
            warn: i("warn"),
            error: i("error"),
            debug: function() {
                var t = i("debug");
                return function() {
                    e && t.apply(n, arguments)
                }
            }()
        }
    }
    ]
}

设置

.html    
<td>
 <textarea ui-tinymce='tinymceOptionsRead' ng-model='originalText' ></textarea>
</td>
.js 
   class HtmlvalueComponent {
        constructor($scope) {
          this.$scope.tinymceOptionsRead = {
            menubar: false,
            theme: 'modern',
            plugins: '',
            toolbar: false,
            readonly: true,
            statusbar: false,
            height: 170,
          };
        }

因为错误日志中没有其他信息,Google没有提供解决方案我需要帮助。

如果我在.js文件中对tinymceOptionsRead进行评论而未在.html中将其设置为<textarea ui-tinymce ng-model='originalText' ></textarea>,那么它仍会抛出两个错误。 如果我只评论TinyMce了 <!--textarea ui-tinymce ng-model='originalText' ></textarea-->
然后错误消失了,所以问题存在于某个地方 网站上的其他所有内容都像按钮,CRUD等一样工作 我安装了最新的版本:
TinyMce:4.5.2
ui-TinyMce:0.0.18
角度:1.5.8

1 个答案:

答案 0 :(得分:-1)

将jquery.min.js文件放在任何脚本上方页面的header部分下。这招对我有用。