Pass template as parameter


#1

Is there a way to pass template as parameter ?
something like this:

component.html

<template name="custom_UI">
    <span>
        {{> {{primary_element}} }}
        some content
        <span>
              {{> {{panel_template}} }}
              some content
        </span>
    </span>
</template>

and then use it like this

{{> custom_UI primary_element="button_0" panel_template="panel_0"}}
{{> custom_UI primary_element="button_1" panel_template="panel_1"}}

<template name="button_0">some content</template>
<template name="panel_0">some content</template>

<template name="button_1">some content</template>
<template name="panel_1">some content</template>


#2

I think you’re looking for dynamic templates.


#3

even with dynamic template it did not work the main issue is how to pass template instance not string with the name of the template or how to create instance of template by it’s name.