我正在尝试绑定(bind)值并从 dart 中的扩展类中观察,但不知何故它不起作用。
class Item extends ObservableBase {
@observable String subject;
Item(this.subject);
}
class TopItem extends Item {
TopItem(String subject):super(subject);
}
使用此绑定(bind)不起作用:
topItem = new TopItem("subject");
<input type="text" value="{{topItem.subject}}"/>
如果我使用 Item 它工作正常。
我在这里做错了什么?
多谢
最佳答案
这是一个错误。
John Messerly 在 Web UI 邮件列表中回答了这个问题(参见 https://groups.google.com/a/dartlang.org/d/msg/web-ui/WRLhW8fIm_E/FGdtvvnADT4J)。
您可以在以下位置阅读有关该错误的信息:
https://github.com/dart-lang/bleeding_edge/blob/master/dart/pkg/observe/lib/src/observable.dart#L117
修复错误后,我将在此处更新答案。
关于dart - 观察扩展类中的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18738086/