From the course: Building Angular and ASP.NET Core Applications
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Updating existing data from Angular
From the course: Building Angular and ASP.NET Core Applications
Updating existing data from Angular
- [Instructor] Now let us see how we can update existing data in Angular. So in our case we are going to see how we can update an existing book from our collection. We are going to first create a method in our service. Then we are going to create the view. Then we are going to create the FormGroup in our component.ts file. And to use the method from our service we are going to inject the service. Then next, we are going to send a request and handle response. So let's go to visual code and see this in action. Let us first create the service method. So inside source, app, services, book.service.ts. Here we are gong to create a method which we are going to name updateBook which takes as a parameter a book that we are going to return of this.http dot want to send a put request this.baseURL and then we write inside double quotes UpdateBook slash we want to append to this one the book ID. Because we want to paste the book ID…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Angular key concepts2m 25s
-
(Locked)
Generating components and services4m 47s
-
(Locked)
Cleaning up code and updating the router7m 11s
-
(Locked)
Designing the Books page8m 10s
-
(Locked)
Reading data from Angular3m 39s
-
(Locked)
Designing the Create page9m 4s
-
(Locked)
Adding new data from Angular9m 50s
-
(Locked)
Designing the Book Details page7m 44s
-
(Locked)
Getting a single book from Angular3m 18s
-
(Locked)
Updating existing data from Angular9m 20s
-
(Locked)
Deleting data from Angular6m 45s
-
(Locked)
Handling errors in Angular12m 24s
-
-
-
-