Javascript 未定义jsonlint-codemirror
我在angular应用程序中实现了ui codemirror。打开lint后,控制台中出现错误:Javascript 未定义jsonlint-codemirror,javascript,angularjs,codemirror,ui-codemirror,Javascript,Angularjs,Codemirror,Ui Codemirror,我在angular应用程序中实现了ui codemirror。打开lint后,控制台中出现错误: ReferenceError: jsonlint is not defined at https://localhost:9000/bower_components/codemirror/addon/lint/json-lint.js:20:3 林特js:20:3: jsonlint.parseError = function(str, hash) { 这些是我的编辑器选项 $sc
ReferenceError: jsonlint is not defined
at https://localhost:9000/bower_components/codemirror/addon/lint/json-lint.js:20:3
林特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(在我的索引的最底部,在所有其他代码镜像脚本之后)
bower\u组件/codemirr/addon/lint/json lint.js的第20行做什么?@AlexMcMillan jsonlint.parseError=function(str,hash){这是为了帮助您开始调试;)去找出jsonlint
不存在的原因。我假设它是import
ed或require
d,位于json lint.js
的顶部,但它可能是全局的。@AlexMcMillan我找到了罪魁祸首。我是瞎子。真的://依赖于jsonlint.js from”哈哈:)bower_components/codemirror/addon/lint/json lint.js
的第20行做了什么?@AlexMcMillan jsonlint.parseError=function(str,hash){这是为了帮助您开始调试;)去找出jsonlint
不存在的原因。我假设它是import
ed或require
d位于json lint.js
的顶部,但它可能是全局的。@AlexMcMillan我找到了罪魁祸首。我是瞎子。。真的://依赖于jsonlint.js from“哈哈:)
<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>