Javascript 重复项属性未更新
给定此元素模板:Javascript 重复项属性未更新,javascript,dom,data-binding,polymer,polymer-1.0,Javascript,Dom,Data Binding,Polymer,Polymer 1.0,给定此元素模板: <template is="dom-repeat" items="{{_getCatsToDisplay(requestedCats, catObj)}}"> <div class="cat-item" title$="{{_getCatTitle(item)}}"> <span>example</span> </div> </template> 例子 我正在收听attributeCh
<template is="dom-repeat" items="{{_getCatsToDisplay(requestedCats, catObj)}}">
<div class="cat-item" title$="{{_getCatTitle(item)}}">
<span>example</span>
</div>
</template>
例子
我正在收听attributeChanged
上元素生命周期的变化,以更新dom repeat
中每个项目的标题
文本
最终,对象将更改为具有更新的标题,但DOM不会反映此更改,除非我将自定义元素全部重新实例化
当更新DOM repeat
中的对象或item
时,如何确保DOM更新(在本例中,是项的title属性)?请包含显示如何“在DOM repeat
中更新每个项的title
文本”的代码。