Using JsProxy in Dart Polymer 1.0
to enable two-way binding not allow to use this classes on server side. Extending from parent class with JsProxy
also does not solve the problem.
As I tried to work around this problem. I create a class (to using on server side) and then extends from this with JsProxy
:
class Person {
@reflectable String name;
@reflectable int age;
Person(this.name, this.age);
}
class PersonModel extends Person with JsProxy {
PersonModel(name, age) : super(name, age);
}
Object person
does not reflect changes if i change value using set
<my-element>
<p>[[person.name]], [[person.age]]</p>
</my-element>
void main() {
PersonModel person;
set('person', new PersonModel('Tom', 23));
}
Is there any way to use class on client and server side, without the need to maintain two separate class for the client and server? Maybe there are some other ways to solve this?
According to the updates on issue https://github.com/dart-lang/polymer-dart/issues/664 this is currently not supported but there are plans to get rid of this limitation.