items-text-box
Version:
This is an Angular component of a textbox which allows users to input an array of text, and is compatible with Angular Reactive Forms. This component is exactly like the Chips component in Angular Material, as such this component is created for demonstrat
22 lines (21 loc) • 825 B
TypeScript
import { OnInit } from '@angular/core';
import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
export declare class ItemTextBoxComponent implements OnInit, ControlValueAccessor, Validator {
items: string[];
text: string;
touched: boolean;
disabled: boolean;
onChange: (items: string[]) => void;
onTouched: () => void;
removeItem(item: number): void;
ngOnInit(): void;
onEnter(value: string): void;
removeLast(): void;
registerOnChange(onChange: any): void;
registerOnTouched(onTouched: any): void;
setDisabledState(isDisabled: boolean): void;
writeValue(items: string[]): void;
registerOnValidatorChange(fn: () => void): void;
validate(control: AbstractControl): ValidationErrors | null;
private copyAndEmit;
}