📌  相关文章
📜  showDescriptionErrors(){ const descriptionForm = this.postForm.get('description'); if (descriptionForm?.touched && !descriptionForm.valid){ if (descriptionForm.errors.required){ return 'Description is required'; } - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:42.850000             🧑  作者: Mango

代码示例3
export const passwordMatchingValidatior: ValidatorFn = (control: AbstractControl): ValidationErrors | null => {
  const password = control.get('password');
  const confirmPassword = control.get('confirmPassword');

  return password?.value === confirmPassword?.value ? null : { notmatched: true };
};