From the course: Angular: Building an Interface

Unlock the full course today

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

Managing form submission

Managing form submission - Angular Tutorial

From the course: Angular: Building an Interface

Start my 1-month free trial

Managing form submission

- [Instructor] Let's work on the code for submitting an appointment by filling out this form. You're in for a treat, 'cause Angular makes it super simple. And we'll start out in the app.module by importing something else from the library called the FormsModule. (keyboard clicking) Right, once I import it, I need to also import it right here as well. And I'm going to save that. And now I can easily add some form submission features into our add.component.html. So let's make this a little bit bigger. Alright, the way this is going to work is that what you want is any input field that you want to store or keep track of as somebody fills it out, you want to make sure that it has a name attribute, like this, like this one has a name of petName. And let's do a search, and we'll do a search for name equals quotation. And you can see that all the fields that I want to keep track of, have a name attribute, like any form element that you want to control should. So all I need to do is at the end…

Contents