Custom template within core-list

31 views
Skip to first unread message

David Bismut

unread,
Feb 26, 2015, 9:36:11 AM2/26/15
to polym...@googlegroups.com
Hi,

I'm wrapping the core-list element into a custom list-test element like this:

<polymer-element name="list-test" attributes="object">
  <template>
    <!-- other HTML code -->
    <core-list>
      <template>
        <content select=".test"></content>
      </template>
    </core-list>
  </template>

  <script>
    (function () {
      Polymer({
    })();
  </script>
</polymer-element>

And I would like to use my list-test element like this, so I can dynamically chose the custom element that will display the core-list items.

<list-test>
  <list-item class="test"></list-item>
</list-test>

I'm full aware that this is not the right way to use the content tag and that it won't work. I've tried to search for similar topics here and there without success. I've found a more-list item in Polymer labs, but I'm not sure how the shadowFromTemplate function would work.

Is there a way to make this works?
Thanks!!

David Bismut

unread,
Feb 26, 2015, 10:20:15 AM2/26/15
to polym...@googlegroups.com
I've tried something else having:

<core-list>
  <template>
    <li is="{{itemTemplate}}></li>
   </template>
</core-list>

and :

<list-test itemTemplate="list-item"></list-test>

But the core-list item gets rendered as a regular <li> element...
Reply all
Reply to author
Forward
0 new messages