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 ...
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.
Read now
Unlock full access