Skip to content

Instantly share code, notes, and snippets.

@tolmasky
Created Sep 15, 2014
Embed
What would you like to do?
polymer question
<!--
What I want is for the following:
<father name = "John">
<child name = "Bob">likes lolipops</child>
<child name = "Jessica">likes computers</child>
</father>
to generate:
---
John has two children, Bob and Jessica:
Bob: likes lolipops
Jessica: likes computers
---
Now, if we assume that the <child> polymer tag is properly implemented to spit out a div with "Bob: likes lolipops" as the contents, the father tag....
-->
<polymer-element name = "father" attributes = "name">
<template>
<style>...
</style>
<div layout vertical>
{{name}} has ???{count}??? children, ???{{ iterate child nodes, print out child.name for each }}???<br/>
<!-- I dont know how ot access JS here, so not sure how to turn all child nodes into a children array -->
<content select = "child"></content>
</div>
</template>
<script>
Polymer({});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment