In this lecture, We are looking into the Form states, Form control states
Then we will going to understand How to validate a forms in Angular based on the form states or a form control states.
To validate a template driven form, we use the template variable created on the form control get read the state of that control and based on the state we show the validation error message to the user.
To validate a reactive form, we use validator class to add the desired validators to the form controls using form control class and at last we add that form control to the form group class
on the html template, we use the form group class property and we call the get method to get the child control and then we get the desired states out of the child control to show the error message to the user
Following are the form states available in Angular
1. status
2. submitted
Following are the form control states which are common for Form as well
1. valid
2. invalid
3.pristine
4.dirty
5.touched
6.pending
everything has been covered with simple examples, Please do watch the video till the end to clear understandings
====================================================
Please do not forget to subscribe to my channel for more videos
=====================================================
Your Queries:
learn Angular
angular tutorial
angular tutorial for beginners
angular tutorial with project
angular form validation
angular form validation error messages
reactive form validation in angular
reactive form validation
reactive forms
form validation using angular
validator class in angular
input validation angular
template driven form validation in angular
template driven form validation
template driven form
how to validate forms in angular
how to make reactive form in angular
validation angular
input multiple validation message angular
#viewencapsulation #shadowdom
#angular #angulartraining #angularcourse #angulardevelopment
#ng #angular16 #angular_developer #angularcomponents #inputoutput #eventemitters #template #angulartemplate
learnlift-eng
On this page of the site you can watch the video online #angular with a duration of hours minute second in good quality, which was uploaded by the user LearnLift-Eng 12 August 2025, share the link with friends and acquaintances, this video has already been watched 16 times on youtube and it was liked by 2 viewers. Enjoy your viewing!