Reader small image

You're reading from  Expert Angular

Product typeBook
Published inJul 2017
Reading LevelExpert
PublisherPackt
ISBN-139781785880230
Edition1st Edition
Languages
Right arrow
Author (1)
Sridhar Rao Chivukula
Sridhar Rao Chivukula
author image
Sridhar Rao Chivukula

Sridhar Rao Chivukula is a technical lead at Mindtree Ltd and is based out of New York City. He brings with him more than a decade of rich hands-on experience in all aspects of frontend engineering. He has worked with leading companies such as Oracle, Tech Mahindra, and Cognizant Technology Solutions. He has a Bachelor's degree in Information Technology. He is the author of the books Expert Angular and PHP and Web 2.0 Application Interfaces, published by Packt.
Read more about Sridhar Rao Chivukula

Right arrow

Observing HTTP responses

In this section, we will build a JSON API returning movies according to search parameters. Instead of simply waiting for the HTTP query to complete, we will leverage the power of the observer design pattern to let the user know we are waiting and, if need be, execute other processes.

First things first: we need a data source for our IMDB--like application. Building and deploying a server-side application able to interpret an HTTP query and send the result accordingly is relatively simple nowadays. However, this falls outside the scope of this book. Instead, what we will do is fetch a static JSON file hosted at http://bit.ly/mastering-angular2-marvel. This file contains some of the latest movies of the Marvel Cinematic Universe. It contains a JSON array describing fourteen movies as JSON objects. Here is the first movie:

{ 
     "movie_id" : 1...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Expert Angular
Published in: Jul 2017Publisher: PacktISBN-13: 9781785880230

Author (1)

author image
Sridhar Rao Chivukula

Sridhar Rao Chivukula is a technical lead at Mindtree Ltd and is based out of New York City. He brings with him more than a decade of rich hands-on experience in all aspects of frontend engineering. He has worked with leading companies such as Oracle, Tech Mahindra, and Cognizant Technology Solutions. He has a Bachelor's degree in Information Technology. He is the author of the books Expert Angular and PHP and Web 2.0 Application Interfaces, published by Packt.
Read more about Sridhar Rao Chivukula