我有一个标准的Ember
main.js
文件,它的开头是这样的:
this.App = Ember.Application.create({
LOG_TRANSITIONS: true,
VERSION: '1.0.0',
ready: function () {
console.log('App version: ' + App.VERSION + ' is ready.');
}
});
在部署阶段,将其通过jshint
运行,会发现Ember未定义,在服务器上的该特定文件中确实如此。因此,会显示许多错误消息。
script
标记在index.html
中使得Ember
在浏览器中可用:
<script src="scripts/vendor/ember-1.0.0-rc.2.js"></script>
我该如何告诉jshint
关于Ember
的信息?
this.App
之前,在main.js
中添加/* global Ember */
吗?但这对我不起作用。 - blueFastglobal
前面加空格。它必须像这样:/*global Ember */
。你能否更正你的答案,以便我可以接受它? - blueFast/* global Ember */
,错误消失了。 - Lucas