- RxJS Tutorial
- RxJS - Home
- RxJS - Overview
- RxJS - Environment Setup
- RxJS - Latest Updates
- RxJS - Observables
- RxJS - Operators
- RxJS - Working with Subscription
- RxJS - Working with Subjects
- RxJS - Working with Scheduler
- RxJS - Working with RxJS & Angular
- RxJS - Working with RxJS & ReactJS
- RxJS Useful Resources
- RxJS - Quick Guide
- RxJS - Useful Resources
- RxJS - Discussion
RxJS - Creation Operator Ajax
This operator will make an ajax request for the given url. To work with ajax we need to import it first as follows
Syntax
import { ajax } from 'rxjs/ajax';
Let us see an example to see the working of ajax in RxJS −
Example
import { map, retry } from 'rxjs/operators'; import { ajax } from 'rxjs/ajax'; let final_val = ajax('https://jsonplaceholder.typicode.com/users').pipe( map(e => e.response) ); final_val.subscribe(x => console.log(x));
Output
Advertisements