@rxap/material-form-system
Version:
Provides directives and a module to enhance Angular Material forms. It includes features such as displaying control errors, clearing input fields, handling required fields, and managing form field visibility based on defined conditions. The package also o
153 lines (79 loc) • 4.38 kB
Markdown
[**@rxap/material-form-system v19.0.4**](../README.md)
***
[@rxap/material-form-system](../globals.md) / ControlErrorsDirective
# Class: ControlErrorsDirective
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:31](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L31)
## Implements
- `AfterContentInit`
- `OnDestroy`
## Constructors
### new ControlErrorsDirective()
> **new ControlErrorsDirective**(`formField`, `template`, `viewContainerRef`, `cdr`): [`ControlErrorsDirective`](ControlErrorsDirective.md)
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:35](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L35)
#### Parameters
##### formField
`MatFormField`
##### template
`TemplateRef`\<[`ControlErrorsDirectiveContext`](../interfaces/ControlErrorsDirectiveContext.md)\>
##### viewContainerRef
`ViewContainerRef`
##### cdr
`ChangeDetectorRef`
#### Returns
[`ControlErrorsDirective`](ControlErrorsDirective.md)
## Properties
### cdr
> `protected` `readonly` **cdr**: `ChangeDetectorRef`
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:43](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L43)
***
### template
> `protected` `readonly` **template**: `TemplateRef`\<[`ControlErrorsDirectiveContext`](../interfaces/ControlErrorsDirectiveContext.md)\>
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:39](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L39)
***
### viewContainerRef
> `protected` `readonly` **viewContainerRef**: `ViewContainerRef`
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:41](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L41)
## Methods
### ngAfterContentInit()
> **ngAfterContentInit**(): `void`
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:54](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L54)
A callback method that is invoked immediately after
Angular has completed initialization of all of the directive's
content.
It is invoked only once when the directive is instantiated.
#### Returns
`void`
#### Implementation of
`AfterContentInit.ngAfterContentInit`
***
### ngOnDestroy()
> **ngOnDestroy**(): `void`
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:66](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L66)
A callback method that performs custom clean-up, invoked immediately
before a directive, pipe, or service instance is destroyed.
#### Returns
`void`
#### Implementation of
`OnDestroy.ngOnDestroy`
***
### render()
> `protected` **render**(`errors`): `void`
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:70](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L70)
#### Parameters
##### errors
`null` | `ValidationErrors`
#### Returns
`void`
***
### ngTemplateContextGuard()
> `static` **ngTemplateContextGuard**\<`T`\>(`dir`, `ctx`): `ctx is ControlErrorsDirectiveContext`
Defined in: [packages/angular/material/form-system/src/lib/control-errors.directive.ts:47](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/material/form-system/src/lib/control-errors.directive.ts#L47)
#### Type Parameters
• **T**
#### Parameters
##### dir
[`ControlErrorsDirective`](ControlErrorsDirective.md)
##### ctx
`any`
#### Returns
`ctx is ControlErrorsDirectiveContext`