kit-value-accessor

README

Why

By default you can't prevent ngModel updating, if user inputs new data.

Scope

  • Input components
  • Input filters and masks

API

[class] KitDefaultModelInterceptor

@Injectable

Members

SignatureDescription
readonly viewStateChanges = new Subject<string>()
readonly modelStateChanges = new Subject<any>()
input(value: string, event: any)
keyDown(event: any)
writeValue(value: any)

[class] KitModelInterceptor

@Injectable

Members

SignatureDescription
viewStateChanges: Subject<string>
modelStateChanges: Subject<any>
abstract input(value: string, event: any): void
abstract keyDown(event: any): void
abstract writeValue(value: any): void

[class] KitValueAccessorDirective

@Directive

Selector:` input:not([type=checkbox]):not([type=radio])[formControlName], textarea[formControlName], input:not([type=checkbox]):not([type=radio])[formControl], textarea[formControl], input:not([type=checkbox]):not([type=radio])[ngModel], textarea[ngModel], [ngDefaultControl] `

Service directive, injects middleware.

Allows to intercept in communication between html input and ngModel.

Examples

Members

SignatureDescription
registerOnChange(fn: any)
registerOnTouched(fn: any)
setDisabledState(isDisabled: boolean): void
writeValue(rawValue: any): void

[class] KitValueAccessorModule

@NgModule

Exports:[ KitValueAccessorDirective, ]