December 2017
Intermediate to advanced
296 pages
5h 56m
English
Now that we understand at a high level all that is present in this web app, we will walk through the services and components.
Open web-app/src/app/services/http-interceptor.service.ts; in this class, we have extended the Http class and implemented the class methods. We have added two methods of our own named requestInterceptor() and responseInterceptor(), which intercept the request and response respectively.
When the request is about to be sent, we call the requestInterceptor() to show a loader, indicating the HTTP activity, and we use the responseInterceptor() to hide the loader once the response arrives. This way, the user is clearly aware if there is any background activity going on.
Next is the LoaderService class; open ...