In this tutorial, we will see how to call a External API from Angular using the HttpClient. We will see :
1. GET Request : We will call a sample GET API without any parameters and to fetch and typecast the result to display in a table grid.
2. GET Request With Parameters :
Here we will call a sample GET API with parameters using the HttpParams in Angular. Here we will call the API and send the required parameter in the GET request and display the data in the table grid.
3. POST Request : Finally, we will see the POST method, in which we will POST a object data to a sample POST API and the API will return the result after Posting the data. And finally we will display the result.
And , last but not the least, we will also see how to solve the undefined error of an object by making it Nullable in the HTML , thus solving the error.