Form Validation in Angular || Template driven Forms Validations || Angular password validation

Pubblicato il: 01 gennaio 1970
sul canale di: Access Zombies Code
1,108
17

Form Validation in Angular || Template driven Forms Validations || Template-Driven Forms.

Here we validating the field using the template driven form and angular material


** Field Validation check type **
required: Value is required.
minlength: The minimum characters are required as a value.
maxlength: The maximum characters are required as a value.
pattern: The value should match the pattern.

** In Angular, we can validate HTML controls as well as forms.
There are different attributes available to validate form's control which return true or false. **
untouched: The control is not touched yet.
touched: The control is touched.
pristine: The control's value is not modified or changed yet.
dirty: The control's value is modified or changed.
invalid: The control's value is not valid.
valid: The control's value is valid.

** We can validate Form also using the following attributes **
pristine: Not any control's value has modified yet.
dirty: Some or all control's values have modified yet.
invalid: Form is not valid since control value is not valid.
valid: Form is valid.
submitted: The form has submitted.


** Pattern for Email **
pattern="^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$"

* Pattern for Password*
pattern="(?=^.{8,}$)(?=.*\d)(?=.*[!@#$%^&*]+)(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$"

** Pattern for Mobile no **
pattern="^((\\+91-?)|0)?[0-9]{10}$"


In questa pagina del sito puoi guardare il video online Form Validation in Angular || Template driven Forms Validations || Angular password validation della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Access Zombies Code 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,108 volte e gli è piaciuto 17 spettatori. Buona visione!