core-list

51 views
Skip to first unread message

Lucas Macdonald

unread,
Jan 14, 2015, 10:21:07 AM1/14/15
to polym...@googlegroups.com
Hi...im trying to have a core-list change it's template to a whole new template. 

I have a component that uses core-list in it's template and builds the template for the core-list based on a template that is passed to it. 

The issue is that if I send it a new template, the core-list refuses to change it's template.

Before I bang my head on a wall for too much longer, I wondered if it is even possible for a core-list can change it's template to a whole new template after it has been rendered?




Cayter Goh

unread,
Jan 14, 2015, 11:54:23 AM1/14/15
to polym...@googlegroups.com
Hi there,

I guess you can pre-insert the template inside the DOM and use `if` to control which one you want to use. For example, the concept code will look like this:

<core-list data="{{ data }}">
   
<template>
     
<template if="{{ mode === 0 }}">
         ...
     
</template>

     
<template if="{{ mode === 1 }}">
         ...
     
</template>

     
<template if="{{ mode === 2 }}">
         ...
     
</template>
   
</template>
</core-list>

Just remember to change the `mode` variable in your component's script accordingly. Thanks.


Best Regards,
Cayter

Reply all
Reply to author
Forward
0 new messages