A Reactive HTTP module for Angular. Reactive? Yes, I super-charged the module with the RxJS library.
RxJS stands for __R__eactive E__x__tensions for __J__ava__S__cript.
This is my own implementation/clone of the Angular
You can pull in from
NPM using the command:
npm i ng.http.lib -S
yarn add ng.http.lib
Yeah, I know, the name looks weird and with the double dots, its kind of creepy, I would say. I originally named it
ng_http, but I couldn't publish with the name 'cos of too many similiar names on
NPM, so I had to conjure up that.
Import the HttpModule in
Http class was implemented. Like in the official Angular HTTP module, it has methods for
Though, I only implemented the
get method. Don't worry, I'll fix other methods or you can help by contributing to the project. I built this module just to demonstrate how Angular modules work and how
Reactive Programming) was incorporated into the HTTP module unlike other
HTTP libraries we have always seen (axios etc.).
The Http class is available to the whole Angular app because it was added to HttpModule's
providers array. So you do not have to re-import it in your own sub-modules. So, inorder to use HTTP methods, import it in your Component/Directive/Service like this:
You see the
this.http.get method returns an Observable, which we subscribe to the stream, to get our values.