You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, we can't return an observable anymore when using toRx() see the change here.
We can return an observable with _subject, though. But it just doesn't feel right.
Does anyone have any word on it? Should I still be using EventEmitter for that kind of situation or just switch to Rx's Observables?
Here's the full code:
import{Component,View,EventEmitter,OnInit,bootstrap}from'angular2/angular2';classSomethingService{_ee: EventEmitter=newEventEmitter();fireStuff(){setTimeout(()=>{this._ee.next('fire!');},1000);//return this._ee.toRx(); - doesn't work anymorereturnthis._ee._subject;// silly work around}}
@Component({selector: 'hello',viewBindings: [SomethingService]})
@View({template: ` <h3>hello - uncomment line 11 and comment line 12 to see the error</h3> <button type="button" (click)="fire()">btn</button> <pre [text-content]="f"></pre> `})exportclassHelloimplementsOnInit{f: string;constructor(private_ss: SomethingService){}onInit(){console.log('hello init');}fire(){this.f="loading";this._ss.fireStuff().subscribe((info)=>{this.f=info;});}}bootstrap(Hello);
Looks like we've got a problem with EventEmitters now. Either that or I'm missing something.
Here is the plnkr with the situation: http://plnkr.co/edit/9w5nzAuMkE1BHoTo2GxN?p=preview
Basically, we can't return an observable anymore when using
toRx()
see the change here.We can return an observable with
_subject
, though. But it just doesn't feel right.Does anyone have any word on it? Should I still be using EventEmitter for that kind of situation or just switch to Rx's Observables?
Here's the full code:
Old issue: #3580
cc: @ericmartinezr @robwormald @pkozlowski-opensource
The text was updated successfully, but these errors were encountered: