Add Validation Rules to Our Forms

Discover how Angular allows to apply the validation rules to the client forms.

Validating form fields on the client side helps ensure that the data reaching the server is in good shape and provides immediate feedback, improving the user experience for our application. However, this only partially removes work from the server-side. The backend is always considered the last guard, where stricter checks are executed because we can’t trust client data. In fact, not only might the user provide some invalid values—for example, a password with only three characters—but client-side validation can be easily bypassed. Therefore, client-side form validation must always be coupled with its server-side counterpart.

Get hands-on with 1400+ tech skills courses.