Polymer 使用聚合物从元素更改自动绑定模板
您的代码应该可以工作,但设置Polymer 使用聚合物从元素更改自动绑定模板,polymer,polymer-1.0,Polymer,Polymer 1.0,您的代码应该可以工作,但设置标题需要等待聚合物准备就绪(即元素已经注册并准备好与之交互) 你是对的,我的代码起作用了。我的问题在别处,你的回答帮助我到达了那里。塔克斯 <template is="dom-bind" id="app"> <div>{{title}}</div> <my-element></my-element> </template> var app = document.querySelector
标题
需要等待聚合物准备就绪(即元素已经注册并准备好与之交互)
你是对的,我的代码起作用了。我的问题在别处,你的回答帮助我到达了那里。塔克斯
<template is="dom-bind" id="app">
<div>{{title}}</div>
<my-element></my-element>
</template>
var app = document.querySelector('#app');
app.title = 'Zaphod';
var app = document.querySelector('#app');
document.addEventListener("WebComponentsReady", function () {
app.title = 'Zaphod';
});