Hello, I’m new to Ember.
I have a list of elements (ember model) where one element must be rendered using a different template. I’ve been reading through Ember’s documentation and believe that Creating a custom Ember.CollectionView is the way .
App.PendingListView = Ember.CollectionView.extend({
createChildView: function(viewClass, attrs) {
if (attrs.content.isConfirmed) {
viewClass = App.FirstView;
} else {
viewClass = App.SecondView;
}
return this._super(viewClass, attrs);
}
});
//Template
{{view 'pending-list'}}
I get my the content (model in the route) as follows.
App.PendingRoute = Ember.Route.extend({
model: function() {
return this.store.find('pendingList');
},
});
However, I don’t know how to pass this content to the CollectionView. My CollectionView renders nothing because content is null.