jsonlint未定义 - codemirror

时间:2016-01-25 23:12:01

标签: javascript angularjs codemirror ui-codemirror

我在角度应用程序中实现了ui-codemirror。打开lint后,我在控制台中出错:

ReferenceError: jsonlint is not defined
at https://localhost:9000/bower_components/codemirror/addon/lint/json-lint.js:20:3

lint.js:20:3:

  jsonlint.parseError = function(str, hash) {

这些是编辑器的选项

     $scope.cmOption = {
        value: "/*WRITE YOUR INSTRUCTION HERE*/",
        lineWrapping : true,
        lineNumbers: true,
        textWrapping: true,
        indentWithTabs: true,
        readOnly: false,
        theme: 'neat',
        mode: "application/json",
        matchBrackets: true,
        autoCloseBrackets: true,
        gutters: ["CodeMirror-lint-markers"],
        lint: true
    };

此处包含lint.js(在我的索引的最底部,在所有其他codemirror脚本之后)

<script src="bower_components/codemirror/addon/lint/lint.js"></script>
<script src="bower_components/codemirror/addon/lint/javascript-lint.js"></script>
<script src="bower_components/codemirror/addon/lint/json-lint.js"></script>

0 个答案:

没有答案