This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Error in example from /devguide/templates.html#dom-bind #1275
Comments
tomalec
added a commit
to tomalec/docs
that referenced
this issue
Jul 27, 2015
Proposed solution for Polymer#1275
I posted a PR for it #1276 I tried to make it work for nested templates but with no luck <body>
<!-- Wrap elements with auto-binding template to -->
<!-- allow use of Polymer bindings in main document -->
<template is="dom-bind" id="r">
List:
<iron-ajax url="http://..." last-response="{{data}}"></iron-ajax>
<template id="t" is="dom-repeat" items="{{data}}">
<div>first:<span>{{item.first}}</span> last:<span>{{item.last}}</span></div>
</template>
</template>
</body>
<script>
var r = document.querySelector('#r');
// The dom-change event signifies when the template has stamped its DOM.
r.addEventListener('dom-change', function() {
// auto-binding template is ready.
var t = document.querySelector('#t');
console.log("Root dom-bind works!");
// The dom-change event signifies when the template has stamped its DOM.
t.addEventListener('dom-change', function() {
// dom-repeat template is ready.
console.log("Does nested dom-repeat work?");
});
});
</script> Is there a way to do something like this? |
Ok, above will work, once I will add <iron-ajax url="/path/to/json/api" last-response="{{data}}" auto></iron-ajax> |
tomalec
added a commit
to tomalec/docs
that referenced
this issue
Jul 28, 2015
Fixed by #1276 |
tomalec
added a commit
to tomalec/polymer
that referenced
this issue
Jul 30, 2015
tomalec
added a commit
to tomalec/polymer
that referenced
this issue
Jul 30, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
After copy'n'pasing example from https://www.polymer-project.org/1.0/docs/devguide/templates.html#dom-bind I get:
I suspect it's because
<template id="t" is="dom-repeat" items="{{data}}">
is not yet stamped from<template is="dom-bind">
.The text was updated successfully, but these errors were encountered: