0
我有一個.html文件如下聲明:綁定到一個紙切換按鈕
<paper-toggle-button
id = 'tglBtn'
on-change = '{{ address.sameAddress }}'
on-mouseout = '{{ onChangeToggleBtnHandler }}'>
</paper-toggle-button>
class Address extends Observable
{
@observable
bool sameAddress = false;
}
上執行的應用程序提供了以下堆棧跟蹤:
Exception: Uncaught Error: type 'bool' is not a subtype of type 'Function' of 'f'.
Stack Trace:
#0 minArgs (package:smoke/src/common.dart:53:22)
#1 GeneratedObjectAccessorService.invoke (package:smoke/static.dart:131:24)
#2 invoke (package:smoke/smoke.dart:43:41)
#3 HtmlElement&Polymer.dispatchMethod (package:polymer/src/instance.dart:1054:19)
#4 BindingDelegate&PolymerEventBindings.getEventHandler.<anonymous closure> (package:polymer/src/events.dart:82:32)
#5 _RootZone.runUnaryGuarded (dart:async/zone.dart:1020)
#6 _RootZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:1049)
#7 BindingDelegate&PolymerEventBindings.prepareEventBinding.<anonymous closure>.<anonymou
這似乎是訪問是通過某種形式的JavaScript。
臺關閉>(包:聚合物/ SRC/events.dart:101:67)
有沒有辦法將切換按鈕的狀態直接綁定到屬性。 – 2014-10-05 13:55:15
當您切換切換時,'checked'屬性被設置爲'true'或'false'。 – 2014-10-05 15:20:48