Member-only story

Step by Step Guide on How to make API Call in Angular (ES6 Promise)

Tek Loon
2 min readJun 13, 2020

--

Photo by Caspar Camille Rubin on Unsplash

This post documented down how to make APIs call to the backend server in order to display the data in your Angular App.

Making API Call using HttpClient

Angular Framework provides a module named HttpClientModule which allows you to perform the Http Call to the backend server and retrieve data. We will discuss the step-by-step guide to make an API call in the next section.

Step by Step Guide to Make an API call

Step 1: Import the HttpClientModule into your AppModule.

Angular Framework introduces Service which is where you should perform your API call and write your HttpClient code which we will do in Step 2.

Step 2: Create a LoginService and Inject HttpClient into the Service.

--

--

Tek Loon
Tek Loon

Written by Tek Loon

Coder and Writer. If you enjoy my stories— support me by https://www.buymeacoffee.com/tekloon so I can keep writing articles for the community.

No responses yet