I am new at angular and I try to work with the library rxjs
but it always gives me an error that the observable object does not exist which I import it in the following way:
import {Observable} from 'rxjs/Rx';
which is the way I have seen it is imported so it occurred to me that the full module import {Observable} from 'rxjs';
would be loaded and thus get the observable but then I get the error that the map
property does not exist inside of the observable object that is loaded in the following way import 'rxjs/add/operator/map';
and I finish it loading like this: import {map} from 'rxjs/operators';
and enclosing the operator map
within a pipe(map())
.
Because it happens all that I do not give the modules where they are supposed to be and if I do it the way I've been doing it is not supposed to load all the components making my application slower. I would like to know how to load them correctly without having to load all the components.