src/app/forms/validation/validation.component.ts
selector | app-validation |
styleUrls | ./validation.component.scss |
templateUrl | ./validation.component.html |
Properties |
Methods |
constructor(fb: FormBuilder)
|
||||||
Parameters :
|
createForm |
createForm()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
onSubmit |
onSubmit()
|
Returns :
void
|
onValueChanged | ||||||
onValueChanged(data?: any)
|
||||||
Parameters :
Returns :
void
|
rebuildForm |
rebuildForm()
|
Returns :
void
|
formErrors |
Type : object
|
Default value : {
username: '',
email: '',
password: ''
}
|
hide |
Default value : true
|
registerFrom |
Type : FormGroup
|
validationMessages |
Type : object
|
Default value : {
username: {
required: '',
minlength: '请输入大于4个字符',
maxlength: '请输入小于32个字符'
},
email: {
required: '',
email: '请输入正确的邮箱'
},
password: {
required: '',
pattern: '密码中必须包含数字和字母',
minlength: '请输入大于4个字符',
maxlength: '请输入小于25个字符'
}
}
|
./validation.component.scss