Photo by Tim Mossholder on Unsplash

Most of the time, in our web applications, we read data from the server in order to display it to the user giving him the ability to manipulate that data.

In our Angular applications, the provided data is stored most of the time in objects. We then use those objects in our HTML pages. In addition to the fields read from the server, there may be fields that are used only for the design part and should not be read from the server or sent to it. …

Photo by Luca Bravo on Unsplash

A common situation in developing a web application is fetching data from multiple data sources using HTTP requests. Most of the times, all of these requests are independent but what can we do when we must send a new request only if the previous request returned a successful response.

In the following examples, we will simulate some HTTP requests that will return a message after a specified number of seconds, covering 4 cases:

  1. Iterative execution
  2. Chain execution
  3. Chain execution without error handling
  4. Chain execution with error handling

To simulate a back-end endpoint, we will use:

1. Iterative execution

Let’s consider the next…

Cosmin Crişan

Full Stack Developer. Passionate about technology and software development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store