From the course: Building Applications with Angular, ASP.NET Core, and Entity Framework Core
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Edit question component in Angular
From the course: Building Applications with Angular, ASP.NET Core, and Entity Framework Core
Edit question component in Angular
- [Instructor] In this video, we'll modify our question component so that it changes to an edit question mode once we select an existing question from our question's list. So if we take a look at our app, we'll make each of these questions clickable and when we click on one, it will update all of the inputs with the existing values of the question selected. And then instead of posts, we'll see an edit button instead. We'll also be modifying our API service to work with an observable to allow us to communicate between two components. Since our question component is separate from our question's component. So let's open up our API service to get started. The first thing we'll do is create an observable subject. So above our constructor, let's add a private selected question property to our class and we'll set it to new subject of type any and we'll need to import subject from rxjs in order to have access to that. And rxjs is the library that Angular uses. Which gives it access to…
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.