@proangular/pro-form
Version:
A predefined set of reactive and reusable form input components based on Angular Material.
23 lines (22 loc) • 1.27 kB
TypeScript
import { ElementRef } from '@angular/core';
import { ControlValueAccessor, FormControl, NgControl } from '@angular/forms';
import * as i0 from "@angular/core";
export declare abstract class InputDirective<T> implements ControlValueAccessor {
ngControl: NgControl;
protected readonly elementRef: ElementRef;
constructor(ngControl: NgControl, elementRef: ElementRef);
get formControl(): FormControl<T>;
hint: string | number | null;
id: string;
placeholder: string | null;
label: string;
get isRequired(): boolean;
onChange: (value: T) => void;
onTouched: () => void;
writeValue: (value: T) => void;
registerOnChange(fn: (value: T) => void): void;
registerOnTouched(fn: () => void): void;
scrollIntoView(options?: ScrollIntoViewOptions): void;
static ɵfac: i0.ɵɵFactoryDeclaration<InputDirective<any>, [{ optional: true; self: true; }, null]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<InputDirective<any>, "[proInputDirective][formControl][label]", never, { "hint": { "alias": "hint"; "required": false; }; "id": { "alias": "id"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": true; }; }, {}, never, never, true, never>;
}