Created
September 15, 2014 19:25
-
-
Save tolmasky/55565e3f220952a985a9 to your computer and use it in GitHub Desktop.
polymer question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
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