ember.jsember.js-view

Ember render helper with dynamic controller/template


Does Ember allow rendering dynamic views or only static, where I need to know name of template/controller used?

For example:

{{render view.processStep.filterForm model}}

and view.processStep.filterForm could be mapped to specific template and controller. Using such statement throws Exception:

Uncaught Error: Assertion Failed: You used `{{render 'view.processStep.filterForm'}}`, but 'view.processStep.filterForm' can not be found as either a template or a view.

Solution

  • While I was unable to render a template name with a dynamic input, this is another option. This could be useful for you under the right circumstances, I actually was unable to use this for my own app, and would like the dynamic ability, but here is what I got for you.

    http://emberjs.jsbin.com/sixin/2/edit

    This jsbin shows you what I've done, if you have any questions let me know, but essentially you would need to use an outlet instead, and render your dynamic template into the outlet.