에 대한 찾을 수 없습니다 제공자는,이 같은 이벤트 버스를 정의DI - 각도 다트를 사용 EventBus
class MyModule extends Module {
MyModule() {
bind(EventBus, toImplementation: EventBus);
...
}
}
내가 구성 요소로이 이벤트 버스를 주입 할 때 간단하게 수행하여 :
class MyComponent {
final EventBus _eventBus;
MyComponent(this._eventBus) {}
}
나는 오류가 점점 오전 :
No provider found for EventBus!
을 나는 방법을 몰라 디버그이 ...
이벤트 버스처럼 보이는 외부 라이브러리입니다 :
library event_bus;
import 'dart:async';
@MirrorsUsed(symbols: '*') // Do not keep any names.
import 'dart:mirrors';
class EventBus {
StreamController _streamController;
EventBus({bool sync: false}) {
_streamController = new StreamController.broadcast(sync: sync);
}
...
}
어떤 도움을 환영합니다 ... 감사합니다!
정말 좋습니까? Angular.dart에는 http://stackoverflow.com/questions/22151427에 빌드 된 이벤트 버스가 있습니다. 모듈을 어딘가에 설치해야합니다. –