Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form class="form-horizontal" novalidate [formGroup]="EmployeeForm">
- <fieldset>
- <div [ngClass]="{'has-error':(EmployeeForm.get('Email').touched||
- EmployeeForm.get('Email').dirty) && !EmployeeForm.get('Email').valid}">
- <label>Email</label>
- <input type="email" formControlName="Email" [(ngModel)]="EmployeeForm.Email" />
- </div>
- <div [ngClass]="{'has-error':(EmployeeForm.get('sal').touched||
- EmployeeForm.get('sal').dirty) && !EmployeeForm.get('sal').valid}">
- <b>Salary...</b>
- <input type="number" formControlName="sal" [(ngModel)]="EmployeeForm.sal" />
- </div>
- ngOnInit(): void {
- // this.CascadingComponent.GetCountry();
- this.EmployeeForm = this.fb.group({
- Emp_Id: ['', [Validators.required]],
- EmpName: ['', [Validators.required]],
- Psw: ['', Validators.compose([Validators.required, Validators.maxLength(6)])],
- Gen: ['', [Validators.required]],
- // Cpsw: ['', [Validators.required, Validators.maxLength(6)]]
- //}, { validator: this.checkIfMatchingPasswords('Psw', 'Cpsw')
- Email: ['', [Validators.required]],
- sal: ['', [Validators.required]],
- Cnt_Name: ['', [Validators.required]],
- Dept_Name:['', [Validators.required]]
- })
- }
- EditEmp(Selected: Employee) {
- this.EmployeeForm.setValue(Selected);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement