# va-input-textarea

The following examples exercise the various inputs.
- `control` is the `FormControl` instance
- `placeholder` is the field label that floats when input is present
- `required` applies the required * (NOTE: This is *not* inferred from validators)
- `maxLength` counts the characters if provided, looking like an error state if over the max. Max length validation error handling is unnecessary if this is used.
- `tooltip` is a tooltip
- `errorMessages` overrides the default messages for the validation type. A function can be provided that takes in the error.
    - Defaults are provided for: `required`, `minlength`, and `maxlength`

```html
<va-input-textarea [placeholder]="'Placeholder'" [required]="true" [control]="control1" [tooltip]="'default validators'"></va-input-textarea>
<va-input-textarea [placeholder]="'Placeholder'" [required]="true" [maxLength]='100' [control]="control2" [tooltip]="'custom validators'" [errorMessages]="customErrorMessage"></va-input-textarea>
```

```typescript
class FormsInputTextareaDocComponent {
    ...
    public customErrorMessage: ErrorMessagesMap = {
      'required': 'Its required!!!!',
    };
    ...
    constructor(..., private fb: FormBuilder) {
        this.control1 = this.fb.control('');
        this.control2 = this.fb.control('', [Validators.required, Validators.maxLength(100)]);
    }
}
```


