Imagine having an array of widget objects stored in your controller, with each widget object containing a member variable assigned the name of a component class. How can you make your template call upon that specific component?
//widgets[0].widget.componentClass="blog-post"
{{#each widget in widgets}}
{{widget.componentClass}}
{{/each}}
The example above simply displays strings representing the widget component classes. To actually invoke the components, you can utilize the following approach:
//widgets[0].widgets.viewClass="blogPost"
{{#each widget in widgets}}
{{view widget.viewClass}}
{{/each}
In our previous setup, we used a custom {{renderWidget ...}} tag along with a Handlebars helper, which can be found detailed here. The default render helper encountered issues when trying to render based on a variable name. I am contemplating creating a custom component handlebars helper but unsure where to begin. Any guidance would be appreciated. Thank you.