Looking for angular2 Answers? Try Ask4KnowledgeBase
Looking for angular2 Keywords? Try Ask4Keywords

Angular 2Http Interceptor


What we do with HttpServiceLayer class is extend the Http class from angular and add our own logic to it.

We then inject that class in the bootstrap class of the application and tell angular that were we import the Http class, in the back to insert the HttpServiceLayer.

Anywhere in the code we can simply import

import { Http } from '@angular/http';

But our class will be used for each call.