我们有一个用dart编写的聚合物元素(版本1.0.0-rc.18)。
<list-outer>
元素使用Templatizer行为来迭代对象列表。
<list-outer>
<template>
<iron-label>{{row.name}}</iron-label>
<paper-input value="{{row.name}}"></paper-input>
</template>
</list-outer>
飞镖部分:
@PolymerRegister('list-outer')
class ListOuter extends PolymerElement with Templatizer {
@property
List<Object> datax = [
{"name": "xxx", "age": 2},
{"name": "yyy", "age": 3}
];
ListOuter.created() : super.created() ;
@override
void ready() {
Element template = Polymer.dom(this).querySelector('template');
this.templatize(template);
datax.forEach((row) {
TemplateInstance instance = this.stamp({});
Polymer.dom(this).append(instance.root);
instance.set('row', row);
});
}
}
如果我尝试编辑内部<paper-input>
中的数据,我们总是会得到以下异常。也许我们错过了什么,但不知道是什么。
**Uncaught TypeError: dataHost._templatized._notifyPath is not a function**
Polymer.Templatizer._notifyPathUpImpl @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:11533Polymer.Base._addFeature._notifyPath @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:8009Polymer.Base._addFeature.set @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:8108(anonymous function) @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7118Polymer.Base._addFeature._notifyListener @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7885(anonymous function) @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7151Polymer.Base._addFeature.fire @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6627Polymer.Bind._modelApi._notifyChange @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6904Polymer.Base.extend._notifyEffect @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7185Polymer.Bind._modelApi._effectEffects @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6962Polymer.Bind._modelApi._propertySetter @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6937setter @ index.html
...
答案 0 :(得分:0)