From the course: Building Angular and ASP.NET Web API Apps
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Load data from admin API
From the course: Building Angular and ASP.NET Web API Apps
Load data from admin API
- [Instructor] In this part, we're going to update the hardcoded data in the transaction component to be loaded from the A speedup net web API. For that, let us go Visual Studio Code. In here, to load the data, we have already created a service, and that service is the transaction service. And to use that service, we need to inject it in our component. To inject the service we have set, we need to have the constructor, just constructor, and then pass a parameter near private, the name of the service, which in our case is transaction service, and then the type is transaction service. The transaction service can be found in services, and then the service file. Now that we have the transaction, I'm just going to remove the hard coded data in here. Just going to initialize it using an empty array. Just going to cut it and put it up here. Now we are going to update the component. So the transaction service method is going to be called whenever the component data or the component view is…
Contents
-
-
-
-
-
Create an new Angular project7m 44s
-
(Locked)
Define and creating empty components6m 6s
-
(Locked)
Configure routing and navigation11m 19s
-
(Locked)
Create the transaction Service with HTTP methods11m 6s
-
(Locked)
Design the application header and footer12m 48s
-
(Locked)
Design the list page13m 32s
-
(Locked)
Load data from admin API16m 13s
-
(Locked)
Creating a form21m 4s
-
(Locked)
Create a New transaction by submitting data with HTTP POST9m 3s
-
(Locked)
Update transaction data with HTTP PUT18m 23s
-
(Locked)
Delete a transaction with HTTP DELETE3m 24s
-
-
-
-