I’ve got a setup like this in Ember:
App.ListObject = Ember.Object.create({ knownThings: function() { var ot = this.openThings.get('content'); var ct = this.closedThings.get('content'); var kt = ot.concat(ct); var known = Ember.ArrayController.create({content: kt}); return known; }.property(),openThings: Ember.ArrayController.create({ content: [] }), closedThings: Ember.ArrayController.create({ content: [] }), })
Basically, known things is the combined arrays of openThings and closedThings. I can't seem to figure out how to iterate over knownThings in the template. Just doing{{#each App.ListObject.knownThings }}Does not work as the property needs to be accessed like
App.ListObject.get('knownThings')but that doesn't work in the template unless I'm doing something terribly wrong. Iterating over the other attributes in the template does work (open and closed things)So, how would you iterate over knownThings in the template?
Slight Modifications needed…
Firstly,
Coming to Handlebars iterate using
Let me know if this works…
Update
Working Fiddle…