Рет қаралды 14,932
We are almost done with template driven form in Angular. The only thing which is left to learn is how to retrieve the form data from a template driven form and how to reset a form.
That's what we are going to learn in this lecture. The NgForm object has a value property which contains all the form control as its property and the value entered for those form controls as the value for thos properties.
So, to read the value entered in the form controls of a template driven form, we need to access the value property on NgForm and on that we can access the required property values.
We can also reset the form controls to their initial value and state using reset() method of NgForm. Let's learn these concepts with an example in this lecture.
DOWNLOAD SOURCE CODE FOR THIS SECTION HERE: drive.google.c...