Created
January 13, 2015 22:50
-
-
Save NickBolles/f52b5f4ba843eec9ea9e to your computer and use it in GitHub Desktop.
designer
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
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<template> | |
<ul> | |
<template repeat="{{items}}" id="t"> | |
<li>{{name}} | |
<ul> | |
<template ref="t" repeat="{{children}}"></template> | |
</ul> | |
</li> | |
</template> | |
</ul> | |
</template> | |
</template> | |
<script> | |
Polymer({ | |
created:function(){ | |
this.items = [ | |
{"id":1, "title": "item 1", "children": [ | |
{"id":1, "title": "item 1-1", "children":[ | |
{"id":1, "title": "item 1-1-1"} | |
] | |
}, | |
{"id":1, "title": "item 1-2", "children":[ | |
{"id":1, "title": "item 1-2-1"} | |
] | |
} | |
] | |
}, | |
{"id":2, "title": "item 2", "children":[ | |
{"id":2, "title": "item 2-1"} | |
]}, | |
{"id":3, "title": "item 3"}, | |
{"id":4, "title": "item 4"}, | |
{"id":5, "title": "item 5"} | |
] | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment