emberjs/ember.js — Issue #479: Suggestion for Ember.View.create() + {{view}}
Author: adyates
Created: 2012-02-08 02:42:40+00:00
State: open

Based on my response to this: http://stackoverflow.com/questions/9094811/ember-nested-applications-and-widgets

Fiddle of the example on the homepage: http://jsfiddle.net/PastryExplosion/LTRt2/

In order to illustrate view hierarchy, the following example is given. Most of the JSFiddles on SO also use this paradigm. But using extend() like this doesn't make sense from an OO standpoint as the description of the View is being intertwined with the data itself. Moreover, the only way to render this is by directly calling the extended class. Why would one render a description directly?

It also seems to conflict with the examples of Ember.ViewState I've seen floating around, which do use Ember.View.create().

The second line in the JSFiddle (and the natural result of designing my models according to the SO post above) is the way I'd prefer to solve this problem. This would be particularly important for times when I have a CollectionView of heterogenous items (e.g. I'm making a dynamic web form and I don't know the input classes until I get the template from an AJAX call), especially when each individual view has a templateName specifically defined.