UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

28 lines (27 loc) 1.33 kB
import { OnDestroy, OnInit } from '@angular/core'; import { NgControl } from '@angular/forms'; import { Observable, Subject } from 'rxjs'; import * as i0 from "@angular/core"; /** * * Usage: * If you want to trace value with control. * The difference between aclValueTrack and ngModelChange is that aclValueTrack carries the first value. * So it is not for changes, but for value traces * For compatibility and cover the deprecation of ngModelChange, we provide aclValueTrackSkipFirst option * eg: * <input formControlName="name" [aclValueTrack]="function()"> * */ export declare class ControlValueTraceDirective implements OnInit, OnDestroy { private readonly ngControl; aclValueTrackSkipFirst: boolean; aclValueTrack: (value?: unknown) => void; aclValueTrack$: Observable<(value?: unknown) => void>; destroy$$: Subject<void>; ngOnDestroy(): void; ngOnInit(): void; constructor(ngControl: NgControl); static ɵfac: i0.ɵɵFactoryDeclaration<ControlValueTraceDirective, [{ host: true; }]>; static ɵdir: i0.ɵɵDirectiveDeclaration<ControlValueTraceDirective, "[aclValueTrack]", never, { "aclValueTrackSkipFirst": { "alias": "aclValueTrackSkipFirst"; "required": false; }; "aclValueTrack": { "alias": "aclValueTrack"; "required": false; }; }, {}, never, never, true, never>; }