UNPKG

@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

25 lines (24 loc) 1.4 kB
import { AfterContentInit, ChangeDetectorRef, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core'; import { AbstractControl, ValidationErrors } from '@angular/forms'; import { MatFormField } from '@angular/material/form-field'; import * as i0 from "@angular/core"; export interface ControlErrorDirectiveContext { $implicit: any; control: AbstractControl; } export declare class ControlErrorDirective implements AfterContentInit, OnDestroy { private readonly formField; protected readonly template: TemplateRef<ControlErrorDirectiveContext>; protected readonly viewContainerRef: ViewContainerRef; protected readonly cdr: ChangeDetectorRef; key: string; private _subscription?; private _control?; constructor(formField: MatFormField, template: TemplateRef<ControlErrorDirectiveContext>, viewContainerRef: ViewContainerRef, cdr: ChangeDetectorRef); static ngTemplateContextGuard<T>(dir: ControlErrorDirective, ctx: any): ctx is ControlErrorDirectiveContext; ngAfterContentInit(): void; ngOnDestroy(): void; protected render(errors: ValidationErrors | null): void; static ɵfac: i0.ɵɵFactoryDeclaration<ControlErrorDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ControlErrorDirective, "[rxapControlError]", never, { "key": { "alias": "rxapControlErrorKey"; "required": true; }; }, {}, never, never, true, never>; }