Closed yann-stepienik-cko closed 7 years ago
Two things:
1) Wrong library you want here
2) Unless you take the kitchensink approach and import rxjs/Rx
(I think) then you need to add each operator that you want to use.
import 'rxjs/operator/add/map';
import 'rxjs/operator/add/filter';
/// etc etc
Hello!
1- not sure what you mean ? Ajax is part of RXJS-DOM isn't it 2- Tried it :
import { Observable } from 'rxjs/Observable';
import { map } from 'rxjs/operator/map';
import { ajax } from 'rxjs/observable/dom/ajax';
ajax({...}).map(...)
I get :
TypeError: (0 , _ajax.ajax)(...).map is not a function
But thanks you for your comment as you mentioned, if I import the full set of rxjs/Rx
it does work indeed. I'll do that for now, that will do, thanks again !
Working code :
import { Observable } from 'rxjs/Rx';
import { ajax } from 'rxjs/observable/dom/ajax';
ajax({...}).map(...)
@yann-stepienik-cko technically yes there is Ajax in this library but this is for RxJS 4 and below. RxJS 5 keeps ajax in the main library https://github.com/ReactiveX/rxjs/tree/master/src/observable/dom since they don't yet have a module strategy.
Let me know if you have any other questions. And if you have further questions I would lodge issues on that board or stackoverflow.
Oh I see thanks for clarification, I'm closing the issue !
I can't call anything else than subscribe on the ajax observable