Skip to content

Instantly share code, notes, and snippets.

@huafu
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huafu/ec19181c316646278587 to your computer and use it in GitHub Desktop.
Save huafu/ec19181c316646278587 to your computer and use it in GitHub Desktop.
Ember Starter Kit// source http://emberjs.jsbin.com/yebaca
<script type="text/x-handlebars" data-template-name="index">
{{each itemView='dummy'}}
</script>
<script type="text/x-handlebars" data-template-name="dummy">
IN DUMMY TEMPLATE
{{view.val}} {{t}}
</script>
App = Ember.Application.create();
App.DummyView = Ember.View.extend({
templateName: 'dummy',
val: 'cocorico'
});
App.IndexController = Ember.ArrayController.extend({
model: [{t: '1'}, {t: '2'}],
viewName: 'dummy',
viewClass: App.DummyView
});
@huafu
Copy link
Author

huafu commented Oct 23, 2014

{{each itemView='dummy'}} works, but before it used to work with dynamic view class or name,and now that do not work anymore:

  • {{each itemView='dummy'}} => OK
  • {{each itemView=viewName}} => broken
  • {{each itemView=viewClass}} => broken
  • the 2 last ones with itemViewClass instead of itemView do not work as well

I don;t remember how it used to work, but it used to work with at least one of the 4 not working above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment