Hi,
I would like to have a core-list display some of my custom components. I
have an itemList [myComponent1, myComponent2, ...] and I add and remove
components- the components in itemList can be of slightly different kinds
and while they are not very complicated, its easier to create them
elsewhere and add/delete them to the list to be rendered as required.
But I can't figure out how to get core-list to actually render them- this
doesn't work:
<template>
<template bind repeat="{{item in itemList}}">
{{item}}
</template>
</template>
I have read this post and the FAQ, which offers a nice way to inject some
html into another component:
"Rendering Html"
https://groups.google.com/forum/#!searchin/polymer-dev/setInnerHTML/polymer-dev/qs5ZQ7XaG6U/mxacQPy_OVUJ
https://www.polymer-project.org/resources/faq.html#setinnerHTML
<polymer-element name="p-html" attributes="html">
<script>
Polymer('p-html', {
htmlChanged: function() {
this.innerHTML = this.html;
}
});
</script>
</polymer-element>
<template>
<template bind repeat="{{item in itemList}}">
<p-html html="{{item}}"></p-html>
</template>
</template>
But its actually my own component I want as the list element.
The recent injectBoundHTML() looks interesting, but it doesn't seem to
quite solve this problem.
https://github.com/Polymer/docs/issues/607
>From reading the docs, I think it might be possible to create a <ul></ul>
in the template and manage adding/deleting my components manually. But the
core-list is nice and saves me a lot of work if I can get it to do this for
me.
It seems like this should be quite straightforward to do (if only I
understand more about templates). Has anyone done something like this? If
it is not possible, is there a simple reason why it can't be done?
many thanks,
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/20d92586-c048-4fa8-b48a-7826b7ee0ce6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.