im是ember.js框架的新成员,使用ruby on rails和ember.debug.js-v1.10.1(最新版本)。我一直在网上读到ember更改了这个最新的补丁,但我不知道如何解决我的问题:
Uncaught Error: Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`.
有人能帮我推动编译器正常运行吗?我希望我知道我的项目中的哪些代码片段将有助于确定答案。。。
这篇文章可能会帮助你:
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>
如果您使用的是ember-cli,那么您的模板应该是预编译的,您不应该有这个问题。
我们需要在应用程序中包含ember-template-compiler.js。我认为ember rails默认情况下不包括这一点。
将其添加到您的app/assets/javascripts/application.js 中
//= require ember-template-compiler