A ton of SO answers say that to avoid problems like
Property 'toPromise' does not exist on type 'Observable'
in Angular, you have to import 'rxjs/add/operator/toPromise' which I've done until recently. In an Angular 4.2.4 project, I forgot the import and expected to see an error. It wasn't there! I did some debugging in Chrome's dev tools and saw "toPromise" on the Observable's prototype.
My question is ... how did that get there? Is this a new addition to TypeScript, Angular, or rxjs?
As of rxjs 5.5.0-beta.5
toPromise: now exists as a permanent method on Observable (2e49a5c)
https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#550-beta5-2017-10-06
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With