如何在 ContainerView 中初始化子元素?
例如,这个模板:
{{#view Ember.CardLayout}}
{{view Ember.TextField}}
{{/view}}
这个观点:
/**
* [Table description]
* @type {[type]}
*/
Ember.CardLayout = Ember.ContainerView.extend({
title: null,
// ???
childViews: ['testView'],
testView: Ember.Checkbox.create(),
render: function(buffer) {
this.forEachChildView(function(view) {
view.renderToBuffer(buffer);
});
}
});
非常感谢!