Skip to content

Instantly share code, notes, and snippets.

@NickBolles
Created January 13, 2015 22:50
Show Gist options
  • Save NickBolles/f52b5f4ba843eec9ea9e to your computer and use it in GitHub Desktop.
Save NickBolles/f52b5f4ba843eec9ea9e to your computer and use it in GitHub Desktop.
designer
<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