import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { patternValidator } from '../../shared/patternValidator';

@Component({
  selector: 'knk-registrationl',
  templateUrl: './registration1.component.html',
  styleUrls: ['./registration1.component.css']
})

export class Registration1Component {

   // userName = new FormControl();

  registrationForm = new FormGroup ({
    userName: new FormControl('', { validators: Validators.required } ),
    password: new FormControl('', { validators: Validators.required } ),
    email: new FormControl('', { validators: [Validators.required, patternValidator(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)]})
  }); // , {updateOn: 'blur'}
}
