Uncaught Error: Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`

随声附和 提交于 2020-01-03 14:15:32

问题


im new to the ember.js framework and using ruby on rails and ember.debug.js -v 1.10.1(latest release). I have been reading online that ember changed this latest patch but i cant figure out how to fix my problem of:

Uncaught Error: Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`.

Could someone please nudge me in the direction to getting my compiler to run properly? i wish i knew what code snippets from my project would help determine the answer...


回答1:


This post may help you:

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

If you're not using ember-cli - your HTML should look something like this:

<script src="assets/ember-template-compiler.js"></script>
<script src="assets/ember.debug.js"></script>

If you are using ember-cli your templates should be precompiled and you shouldn't be having that problem.




回答2:


We need to include the ember-template-compiler.js in our application. I think ember-rails does not include this by default.

Add this in your app/assets/javascripts/application.js

//= require ember-template-compiler



来源:https://stackoverflow.com/questions/28843787/uncaught-error-cannot-call-compile-without-the-template-compiler-loaded-plea

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