With Polymer 0.8+ you can use *yourFieldName**Changed. When the observed property changes, the Changed
method will be called. Since String text
is two way data bound, changing the value of the textarea will change the value of String text
and call the textChanged
method. This works with your original code and doesn't need ObservableBox
import "dart:html";
import 'package:polymer/polymer.dart';
@CustomTag('dictionary-converter')
class DictionaryConverter extends PolymerElement with ObservableMixin {
@observable String text = "Initial text";
textChanged(oldValue) {
print("textarea: ${this.shadowRoot.query("textarea").value}");
print("text: ${text}");
}
}