【发布时间】:2012-06-19 23:21:36
【问题描述】:
假设我有这样的看法:
App.AnchorView = Ember.View.extend({
tagName: 'a',
attributeBindings: ['href']
});
还有一个类定义:
App.Item = Ember.Object.extend({
name: "Unknown Entry",
location: ""
});
还有一个类的实例:
App.Item.create({
name: "Google",
location: "http://www.google.com"
});
我的模板是:
{{#view App.AnchorView}}{{name}}{{/view}}
我希望它呈现为:
<a href="http://www.google.com">Google</a>
我该怎么做?
【问题讨论】:
标签: templates attributes ember.js attr