How to load partials / views / templates dynamically in Ember.js

后端 未结 4 1509
耶瑟儿~
耶瑟儿~ 2021-02-04 14:14

So I have the following setup.

On the main page, a list of generators is being displayed based on a list coming from a model using fixture data.

Now when one of

4条回答
  •  北海茫月
    2021-02-04 15:09

    You should be able to simply place your dynamic partial variable within the partial helper.

    {{#each item in controller}}
        {{partial item.templateName}}
    {{/each}}
    

    As @darshan-sawardekar pointed out if you have a generator with templateName of generator-1it would render the partial _generator-1.

提交回复
热议问题