👉

Did you like how we did? Rate your experience!

Rated 4.5 out of 5 stars by our customers 561

Award-winning PDF software

review-platform review-platform review-platform review-platform review-platform

Video instructions and help with filling out and completing Are Form 2350 Edit

Instructions and Help about Are Form 2350 Edit

This is part 27 of the Angular 6 tutorial. In this video, we'll discuss implementing the edit operation in a reactive form. We'll use the employee form for both creating a new employee and editing an existing employee. We already have a create route to support creating a new employee within our app routing module. Now, we need a new route for editing an existing employee. To do this, we'll make a copy of the create route and change the necessary bits. The path should be "edit" to indicate that we are editing a specific employee. We also need to pass the employee ID as a route parameter. We'll name this route parameter "ID". In our `list-employees` component, when we click the edit button, we want to redirect the user to the new edit route. So, let's add a click event binding to the edit button. We'll call a method called `editButtonClick`. We don't have this method yet, but we'll create it shortly. In this method, we want to pass the ID of the employee whose details we want to edit. We already have the employee object, so we can use its ID property to get the ID. To navigate the user to the edit route, we need to import the Angular Router service and inject it into the component class using the constructor. In the event handler method, let's navigate the user to the edit route by using the Router service. We need to pass the ID of the employee whose details we want to edit. In our `create-employee` component, we want to read the employee ID from the edit route. For this, we are going to use the Angular `ActivatedRoute` service. So first, let's import it into our component class and inject it using the constructor. In the `ngOnInit` lifecycle hook, let's subscribe to...