jshint complains: 'Ember' is not defined

一个人想着一个人 提交于 2019-12-03 23:29:45

The following should do it:

/*global Ember */
this.App = Ember.Application.create({
    LOG_TRANSITIONS: true,
    VERSION: '1.0.0',
    ready: function () {
        console.log('App version: ' + App.VERSION + ' is ready.');
    }
});

Found in JS Hint Docs

If you're using the new ES6, for example from ember-cli, you must import Ember:

import Ember from 'ember';

I was following Evil Trout's Ember Reddit tutorial and saw the following error in the tests:

my-new-app/routes/subreddit.js should pass jshint.
my-new-app/routes/subreddit.js: line 3, col 16, 'Ember' is not defined.

adding the above line to the top of my-new-app/routes/subreddit.js passed the tests.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!