i have two controllers and want to \"send\" between them object. I have something like this:
@NgController(selecto
With the newest AngularDart library (0.10.0), Günter Zöchbauer's solution is still correct, but the syntax has changed a bit:
// Receiver
//import 'dart:async';
String name;
Scope scope;
ReceiverConstructor(this.scope) {
Stream mystream = scope.on('username-change');
mystream.listen(myCallback);
}
void myCallback(ScopeEvent e) {
this.name = e.data;
}
// Sender
scope.emit("username-change", "emit");
scope.broadcast("username-change", "broadcast");
scope.parentScope.broadcast("username-change", "parent-broadcast");
scope.rootScope.broadcast("username-change", "root-broadcast");