未捕获错误:如果没有加载模板编译器,则无法调用`compile`.请在调用`compile`之前加载`ember-template-compiler.js`

Jes*_*son 5 javascript ruby-on-rails ember.js

我是ember.js框架的新手,并在rails和ember.debug.js -v 1.10.1(最新版本)上使用ruby.我一直在网上看到ember改变了这个最新的补丁但我无法弄清楚如何解决我的问题:

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)

有人可以请我指点让我的编译器正常运行吗?我希望我知道我的项目中的代码片段有助于确定答案......

jmu*_*yau 2

这篇文章可能会帮助您:

http://emberjs.com/blog/2015/02/05/compiling-templates-in-1-10-0.html

如果您不使用 ember-cli - 您的 HTML 应该如下所示:

<script src="assets/ember-template-compiler.js"></script>
<script src="assets/ember.debug.js"></script>
Run Code Online (Sandbox Code Playgroud)

如果您使用 ember-cli 您的模板应该是预编译的,那么您不应该遇到这个问题。