We have a polymer element written in dart (version 1.0.0-rc.18).
The <list-outer>
element uses the Templatizer behavior to iterate an object list.
<list-outer>
<template>
<iron-label>{{row.name}}</iron-label>
<paper-input value="{{row.name}}"></paper-input>
</template>
</list-outer>
The dart part:
@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);
});
}
}
If I try to edit the data in the inner <paper-input>
we always get the exception below. Maybe we are missing something, but don't know what.
**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
...
JsProxy
like thisclass PersonData extends JsProxy
still same error. Building withdart2js
and the things works ok in Chrome with no exception. Seems like something missing in the dart wrapper for running in Dartium. Tried with aString
instead of a structured type and worked ok in Dartium.dart2js
build an exception is thrown, but swallown by Chrome and updates the value in the browser ok. The exception in Chrome is similar to that in Dartium