【发布时间】:2015-03-05 22:29:54
【问题描述】:
我想渲染一个我将在变量中定义的组件。
我有一个包含类似内容的变量:
page.js
Ember.Controller.extend({
c: {
'pageTitle': 'This is the title with a component {{my-component}}'
}
});
page.hbs
<div>
{{c.pageTitle}}
</div>
c 对象由 API 调用、内容服务器填充。
我想提供从内容中定义的内容注入组件的能力。
基本上我需要渲染两次,第一次用字符串替换我的{{pageTitle}},第二次用组件替换{{my-component}}。
这样做的最佳解决方案是什么?
谢谢
【问题讨论】:
标签: javascript ember.js handlebars.js