Created
November 13, 2016 14:57
-
-
Save vpusher/7f219b851806d85e079d1234a6fb55cb to your computer and use it in GitHub Desktop.
paper tree demo with bound property
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
<!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