Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <form class="form-horizontal" novalidate [formGroup]="EmployeeForm">
  2. <fieldset>
  3. <div [ngClass]="{'has-error':(EmployeeForm.get('Email').touched||
  4. EmployeeForm.get('Email').dirty) && !EmployeeForm.get('Email').valid}">
  5. <label>Email</label>
  6. <input type="email" formControlName="Email" [(ngModel)]="EmployeeForm.Email" />
  7. </div>
  8.  
  9. <div [ngClass]="{'has-error':(EmployeeForm.get('sal').touched||
  10. EmployeeForm.get('sal').dirty) && !EmployeeForm.get('sal').valid}">
  11. <b>Salary...</b>
  12. <input type="number" formControlName="sal" [(ngModel)]="EmployeeForm.sal" />
  13. </div>
  14.  
  15. ngOnInit(): void {
  16. // this.CascadingComponent.GetCountry();
  17. this.EmployeeForm = this.fb.group({
  18. Emp_Id: ['', [Validators.required]],
  19. EmpName: ['', [Validators.required]],
  20. Psw: ['', Validators.compose([Validators.required, Validators.maxLength(6)])],
  21. Gen: ['', [Validators.required]],
  22. // Cpsw: ['', [Validators.required, Validators.maxLength(6)]]
  23. //}, { validator: this.checkIfMatchingPasswords('Psw', 'Cpsw')
  24. Email: ['', [Validators.required]],
  25. sal: ['', [Validators.required]],
  26. Cnt_Name: ['', [Validators.required]],
  27. Dept_Name:['', [Validators.required]]
  28. })
  29.  
  30. }
  31.  
  32. EditEmp(Selected: Employee) {
  33. this.EmployeeForm.setValue(Selected);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement