运行我的应用程序时出现以下错误:
Uncaught Error: Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`.
Run Code Online (Sandbox Code Playgroud)
它与这段代码有关:
var CarouselView = Ember.View.extend({
template: Ember.Handlebars.compile('{{view view.itemsView}}'),
elementId: 'carousel',
contentBinding: 'content',
...
Run Code Online (Sandbox Code Playgroud)
在ember.js github上已经存在与此问题相关的问题:https://github.com/emberjs/ember.js/issues/10265
但是我添加ember-template-compiler到我的package.json并再次得到相同的错误.
我做了:
npm install --save-dev ember-template-compiler
这是我的package.json devDependencies:
"ember-cli": "0.1.10",
"ember-cli-app-version": "0.3.0",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-htmlbars": "^0.6.0",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.3.0",
"ember-cli-simple-auth": "^0.7.2",
"ember-cli-simple-auth-cookie-store": "^0.7.2",
"ember-cli-simple-auth-oauth2": "^0.7.2",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.12",
"ember-export-application-global": "^1.0.0",
"ember-template-compiler": "^1.8.0",
"express": "^4.8.5",
"glob": "^4.0.5" …Run Code Online (Sandbox Code Playgroud)