Closed jolleekin closed 8 years ago
In wiki/properties#read-onlyproperties, the sample code is not correct. @Property(notify: true) must be used instead of @property.
@Property(notify: true)
@property
@PolymerRegister('my-element') class MyElement extends PolymerElement { MyElement.created() : super.created(); @property // Should be @Property(notify: true) String get myValue => _myValue; String _myValue; @reflectable someEventHandler() { _myValue = 'hello!'; notifyPath('myValue', _myValue); } }
Just @property should be correct. All that the notify: true option does is opt into two way binding (upwards, by firing my-value-changed events), which is a separate thing.
notify: true
In wiki/properties#read-onlyproperties, the sample code is not correct.
@Property(notify: true)
must be used instead of@property
.