Skip to content

Instantly share code, notes, and snippets.

@vpusher
Created November 13, 2016 14:57
Show Gist options
  • Save vpusher/7f219b851806d85e079d1234a6fb55cb to your computer and use it in GitHub Desktop.
Save vpusher/7f219b851806d85e079d1234a6fb55cb to your computer and use it in GitHub Desktop.
paper tree demo with bound property
<!DOCTYPE html>
<html>
<head>
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="bower_components/paper-tree/paper-tree.html" />
</head>
<body>
<template id="t" is="dom-bind">
<h3>GOT Tree: {{selected.data.name}}</h3>
<paper-tree selected="{{selected}}"></paper-tree>
<script>
document.querySelector('paper-tree').data = {
"name": "GOT",
"icon": "theaters",
"open": true,
"children": [
{
"name": "Starks",
"icon": "turned-in"
}, {
"name": "Lannisters",
"icon": "turned-in"
}, {
"name": "Targaryens",
"icon": "turned-in"
}, {
"name": "Baratheons",
"icon": "turned-in",
}
]
};
</script>
</template>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment