Closed pjjjv closed 9 years ago
My config:
dependencies: browser: '>=0.10.0 <0.11.0'
firebase: path: ../firebase-dart dartson: "^0.2.3" paper_elements: '>=0.7.0 <0.8.0' polymer: '>=0.16.0 <0.17.0' transformers:
You can find my test project at https://github.com/pjjjv/test_arrays_binding/blob/a96ae100dffb009665f6c17006b0d4156f02bc31/lib/pane_edit.dart
After some digging I found a solution which is as simple as switching the order of the transformers array. Put dartson in front of polymer.
Your pubspec.yaml should look like this:
name: 'test_arrays_binding'
version: 0.0.1
description: A web app built using polymer.dart.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
browser: '>=0.10.0 <0.11.0'
paper_elements: '>=0.7.0 <0.8.0'
polymer: '>=0.16.0 <0.17.0'
dartson: '>=0.2.3 <0.3.0'
transformers:
- dartson
- polymer:
entry_points: web/index.html
That causes the CodeTransformer for the @observable annotation to be called after dartson has created it's mapping methods which will then use the getter and setter methods created by the Observable CodeTransformer instead of the private properties (__$...) created by the Observable CodeTransformer.
I'm thinking about a proper warning message or detection for these cases.
Thanks, I'll look into it and try converting my project
Dartson works on this example class, but when I add
extends Observable
and@observable
, it stops working. The object is just null. How to fix this?Here is the modified example code: