This code (especially @initMethod
) inside the element doesn't make sense.
@CustomTag('my-list')
does this already. You need @initMethod()
only when you want a method executed like main()
that is outside of an Polymer element.
You can put this code inside the constructor of MyListElement
or better inside polymerCreated
before the super call.
import 'package:polymer/polymer.dart';
import 'dart:html';
@CustomTag('my-list')
class MyListElement extends PolymerElement {
@observable List mylist = ['one', 'two', 'three'];
@override
polymerCreated() {
print("initMethod");
// get json and pass to mylist
super.polymerCreated();
}
}
You didn't get Polymer 0.10.0-pre.10
because it is a pre-release which is indicated by the -
after the patch version (not by pre
).
Pub by default ignores pre-releases. You have to enforce them by a version constraint like '>=0.10.0-'