简体   繁体   English

如何在Ember CLI应用程序中用htmlbar替换车把?

[英]How to replace the handlebars with htmlbars in Ember CLI app?

I am facing the following issue after upgrading the Ember and Ember data to the canary versions. 将Ember和Ember数据升级到Canary版本后,我面临以下问题。

Cannot set property 'compilerInfo' of undefined

I found the discussion about the issue in Ember CLI repo. 我在Ember CLI回购中找到了关于该问题的讨论。

https://github.com/ember-cli/ember-cli/issues/2955 https://github.com/ember-cli/ember-cli/issues/2955

The solution is to replace handlebars with htmlbars. 解决的办法是用htmlbars替换把手。 But I don't know the exact steps to do that. 但是我不知道执行此操作的确切步骤。

I checked handlebars repo. 我检查了车把回购。 It gives code snippets but I don't know where to place the code exactly. 它提供了代码片段,但我不知道确切将代码放置在何处。

Any idea? 任何想法?

You will still be using Handlebars, but you need 2.0. 您仍将使用把手,但您需要2.0。

For HTMLBars, what you'll change is the template compiler. 对于HTMLBar,您要更改的是模板编译器。

npm uninstall --save-dev broccoli-ember-hbs-template-compiler
npm install --save-dev ember-cli-htmlbars
rm -rf bower_components
bower install --save handlebars#2.0.0
bower install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM