From the course: Building Angular and ASP.NET Core Applications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Delete a book

Solution: Delete a book

From the course: Building Angular and ASP.NET Core Applications

Start my 1-month free trial

Solution: Delete a book

(upbeat music) - [Instructor] So, I asked you to delete a book using the NgRx. Now, let us walk through my solution together. In here, let's go inside the ClientApp, and source, app, and store. Let us start with the actiontypes.ts. And here, we are going to add two more constants. So, let us copy these two lines and paste them down here. We are going to name this one Delete_Book, and the other one Delete_Book_Success. Let us change the string values as well. So Delete_Book, Delete, and Delete, and Delete_Book_Success. Now, let us go to the actions file, and here, add two actions. So, the first action's going to be export class deleteBookAction, which implements the Action base class, and the type is going to be readonly type is equal to types.Delete_Book, and the payload for this constructor is going to be of type number because we are going to pass the book ID. So, let us just write in here public_payload…

Contents