我有以下代码片段:
App.TripLegView = Em.View.extend({
transportMeanType: null,
transportMeanTypeChanged: function () {
this.carView = App.CarView.create();
var childView = this.createChildView(this.carView );
this.get('childViews').pushObject(childView);
}
}).observes('transportMeanType'),
App.CarView = Em.View.extend();
但是,当我调试上面的代码时,子视图似乎没有添加到 childViews 数组中。
谁能解释如何正确添加子视图。