Skip to content

Instantly share code, notes, and snippets.

@timoxley
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save timoxley/9260571 to your computer and use it in GitHub Desktop.

Select an option

Save timoxley/9260571 to your computer and use it in GitHub Desktop.
iterate objects polymer. not work.
// 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