I updated my angular 5.2.10 project to angular 6.
I did step by step https://update.angular.io/
, everything is OK unless Observable.from
In a service I used Observable.from(this.user)
as following:
import { Observable } from 'rxjs/Observable';
...
Observable.from(this.users)// this.users is an array
It was OK, but in angular 6 the following error occurred
Property 'from' does not exist on type 'typeof Observable'
I changed it as follows
import { Observable, from } from 'rxjs';
But no change and error occurred again!
This is changed from previous rxjs versions to rxjs6. (RxJS v5.x to v6 Update Guide)
Before rxjs 6
import { Observable } from "rxjs";
let numbers = [1, 5, 10];
let source = Observable.from(numbers);
With rxjs 6
import { from, Observable } from "rxjs";
let numbers = [1, 5, 10];
let source = from(numbers);
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