0
私はDartのクライアントWebアプリケーションをAngular2を使ってプログラミングしています。 dart
さんangular2
パッケージAppComponent
(または任意のクラスmain()
からブートストラップされた)のバージョン3.x以降ダーツでは、Angular2 3.xではAppComponentでゲッターのトグルを行う必要があります
はゲッターtoggled
が必要です。それが欠けている場合は、ブラウザ(Dartium)がエラーを報告:
VM2848:1 EXCEPTION: NoSuchMethodError: Class 'AppComponent' has no instance
getter 'toggled'.
Receiver: Instance of 'AppComponent'
Tried calling: toggled
STACKTRACE:
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:43)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:47)
#2 ViewAppComponent0.build
(package:myproject/app_component.template.dart:140:93)
#3 AppView.create
(package:angular2/src/core/linker/app_view.dart:180:12)
#4 DebugAppView.create
(package:angular2/src/debug/debug_app_view.dart:73:26)
(など)
ため、このゲッター良い何ですか?私は
get toggled =>() => null;
として、それを実装し、私のアプリが動作しているようですが、私はtoggled
を返すことになっているかを知りたいと思います。
ありがとうございます。私は、http:// dart-http://dart-league.github.io/ng_bootstrap/build/web/index.html#dropdownの例を盲目的にコピーしました。これはAngular 2.2.0では動作しましたが、3.0.0では使用できませんでした。 –