Skip to content

Instantly share code, notes, and snippets.

@tolmasky
Created September 15, 2014 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolmasky/55565e3f220952a985a9 to your computer and use it in GitHub Desktop.
Save tolmasky/55565e3f220952a985a9 to your computer and use it in GitHub Desktop.
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