1
votes

I'm new to ember.js and have a problem to display my collectionview:

    var KAListView = Ember.CollectionView.extend({
    tagName: 'kalist'
});
    App.TestlistView = KAListView.create({
    content: [
        {title : "item1",
         sub : "ceci est un sous titre"}"}
        ,
        {title : "item5",
         sub : "ceci est un sous titre"}
        ,
        {title : "item6",
         sub : "ceci est un sous titre"}
        ,
        {title : "item7",
         sub : "ceci est un sous titre"}
],
        itemViewClass: KAListElemView.extend({
        template: elemtemplate
    })
});

When i appentTo('body') this works but i want to add it to my template. I thougt that as the collectionview inheriths from Ember.View I could simply write {{view App.TestlistView}} but i get an error that my object is not a view.

How can I simply display a collection view in my template?

1

1 Answers

3
votes

use {{collection App.TestlistView}} for Collection and more importantly it doesn't inherit from Ember.View It inherits from Ember.ContainerView