import { ElementRef, OnInit } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; import { ValidationService } from '../services/validation.service'; /** * This directive displays a message in the template if a form field is * invalid. * * Note that the validation logic (as of now) must be included in the component * using this directive. * * For example: * this.basicInfoFormGroup = this.fb.group({ * 'firstName': [this.contact.firstName, * [Validators.required, * Validators.pattern('^[a-zA-Z. \-\]*$') * ] * ] * }); * * That validation logic is still required in the component class. * * Here's how this directive is used: * * * * The simpleValidation directive requires a FormControl object. In the example above, * it's retrieved from the FormGroup. * * The fieldLabel property is optional. But it enables the directive to display a * field-specific error message. For example: "First name is required" instead of * "This field is required." **/ export declare class SimpleValidationDirective implements OnInit { private validationService; private elementRef; formField: FormControl; fieldLabel: string; currentlyValid: boolean; formGroup: FormGroup; constructor(validationService: ValidationService, elementRef: ElementRef); ngOnInit(): void; private trackTouchChanges; private trackStatusChanges; private checkValidity; private setUpStyling; triggerValid(): void; triggerError(): void; }