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