Last active
August 29, 2015 13:56
-
-
Save timoxley/9260571 to your computer and use it in GitHub Desktop.
iterate objects polymer. not work.
This file contains hidden or 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
| // paste into console on http://www.polymer-project.org/ and inspect document body | |
| // template appears, but not rendered data | |
| var doc = document.implementation.createHTMLDocument() | |
| doc.body.innerHTML = [ | |
| '<template repeat="{{key, value in items}}">', | |
| ' {{key}} {{value}}', | |
| '</template>' | |
| ].join('\n') | |
| var t = doc.body.firstChild | |
| t.bindingDelegate = new PolymerExpressions() | |
| t.model = {items: { | |
| a: 1, | |
| b: 2, | |
| c: 3, | |
| d: 4 | |
| }} | |
| document.body.appendChild(t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment