Fetching Data through HTTP GET request
Learn to fetch data directly from the Fake Store API using the HTTP GET method.
We'll cover the following
Previously, we used HttpClientModule
to fetch live data from the Fake Store API by passing the selected product as an input property from the product list.
Implementing product details retrieval from API
We will get the product details directly from the API using an HTTP GET
request:
The Fake Store API contains an endpoint method that you can use to get details for a specific product based on its ID. Currently, there is no ID property in the product model, so first, add one in the
product.ts
file:
Get hands-on with 1400+ tech skills courses.