Most applications require some user input and since we can not guarantee that the user enters valid input, we have to set in place some rules before sending
data to the backend.
She has been working for some time with forms, both template-driven and reactive, and one of the challenges is to decide whether validation should be handled in the frontend or the backend. She believes that a mix of both is the right combination.
Frontend should handle these types of validations:
Required or optional. Format: minLength, maxLength, pattern match. Other validations that are easily understandable to any UI user, such as: password and confirm password should have the same value. On the other hand, any
validation that is specific to the business logic should be handled in the backend.
Reactive Forms since they are more scalable and a large form will probably have many rules. There are three main categories of validators that we can apply to a form control.
Built-in Validators Custom Validators Async Validators She applied these validators in a form control and showed how they are implemented and their behaviour.
Learn the best ways to build reliable web applications, write quality code, choose scalable architectures, and create effective automated tests at the Reliable Web Summit this August 26-27, 2021. Powered by the team at ng-conf.
Get your ticket 👉 https://reliablewebsummit.com/
Follow us on twitter https://twitter.com/ngconf
Official Website: https://www.ng-conf.org/