Skip to Content
Practical Internet of Things with JavaScript
book

Practical Internet of Things with JavaScript

by Arvind Ravulavaru
December 2017
Intermediate to advanced
296 pages
5h 56m
English
Packt Publishing
Content preview from Practical Internet of Things with JavaScript

Web app services

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Test-Driving JavaScript Applications

Test-Driving JavaScript Applications

Venkat Subramaniam
Web Caching and Replication

Web Caching and Replication

Michael Rabinovich, Oliver Spatscheck

Publisher Resources

ISBN: 9781788292948Supplemental Content