Skip to main content

Posts

Showing posts with the label Model driven forms

Angular 5/4 Email Validation Regex - Model Driven Form

In this Article, we will see “How Angular 5/4 forms are used or create?”  There are basically two types of Angular forms (login) and its validations. ü   Template driven form ü   Model driven forms ü    Stayed Informed  –  Angular 5 and Angular 4 documentation and example And In this section, I will discuss about Model driven form. Steps 1 - In the NgModule import { FormsModule , ReactiveFormsModule } from '@angular/forms' ; Steps 2 - Create login form < form [ formGroup ]= "logedInForm" ( ngSubmit ) = "mdfLogin(logedInForm.value)" >  //login UI </ form > Steps 3 - Initialize FormGroup and FormControl in ngOnInit method   ngOnInit () {     this . date = new Date (); // Today date and time     this . logedInForm = new FormGroup ({       emailId: new FormControl ( "anil.singh581@gmail.com" , Validators . compose ([ ...