-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamic custom tag names #94
Comments
Hi @yomed, instead of a custom tag (which is associated with a renderer function) you can invoke a data.renderers=[
require('../foo'),
require('../bar'),
require('../baz')
] <for each="renderer in data.renderers">
<invoke function="renderer(myInputObject, out)"/>
</for> I don't know exactly how that fits into your app, but hopefully you get the idea. FYI, a custom tag is resolved to a renderer at compile-time. Please let me know if that doesn't solve your problem. |
Thanks Patrick, that seems to work well. Do you know how I might include w-id in this case? So that
would become something like this...
|
Assigning a |
Ok thanks. That would be great if this could be supported. |
marko-widgets was updated to support the Closing this issue. |
I would like to determine which custom tags get called via my renderer.js
So in the renderer, something like this:
data.details=['d1','d2','d3']
And then in template.marko (which doesn't work):
<for each="detail in data.details">
<${detail} />
</for>
One solution would be to explicitly call out tags conditionally:
<for each="detail in data.details">
<if test="detail==='d1'">
<d1 />
</if>
</for>
But is there any other way to accomplish this?
The text was updated successfully, but these errors were encountered: