Interface ControlLike<FIELD, VALUE, CHILD_FIELD>
interface ControlLike<FIELD, VALUE, CHILD_FIELD> { moveControl: (<IDENTIFIER>(identifier: IDENTIFIER,
index: number) => void); removeControl: (<IDENTIFIER>(identifier: IDENTIFIER) => void); updateState: (<T>(changes: T) => Promise<boolean>); get activeControls(): MFC<CHILD_FIELD>[]; get activeExtensions(): ExtensionBase[]; get afterChanges(): Observable<ControlChange>; get changes(): BehaviorSubject<ControlChange>; get childChanges(): Observable<ControlChange>; get config(): MargaritaFormConfig; get context(): ControlContext<MFC<FIELD>, never>; get controls(): MFC<CHILD_FIELD>[]; get currentRef(): null | MargaritaFormBaseElement<MFC<MFGF<FieldParams>>, HTMLElement>; get expectArray(): boolean; get expectChildControls(): boolean; get expectFlat(): boolean; get expectGroup(): boolean; get extensions(): Extensions; get fieldChanges(): Observable<FIELD>; get fields(): CHILD_FIELD[]; get grouping(): MargaritaFormGroupings; get hasActiveControls(): boolean; get hasControls(): boolean; get index(): number; get isDefaultValue(): boolean; get isInitialValue(): boolean; get isRoot(): boolean; get name(): FIELD["name"] extends string ? any[any] : string; get onSubmit(): Observable<MFC<FIELD>>; get ownChanges(): Observable<ControlChange>; get parent(): MFC<MFGF<FieldParams>>; get resolvers(): MargaritaFormResolvers; get root(): MFC<MFGF<FieldParams>>; get state(): MargaritaFormState; get stateChanges(): Observable<MargaritaFormState>; get validators(): MargaritaFormValidators; value: VALUE; get valueChanges(): Observable<VALUE>; get valueHash(): string; get visibleControls(): MFC<CHILD_FIELD>[]; activate(): void; addControl<CHILD_FIELD>(field: CHILD_FIELD,
replaceExisting?: boolean): MFC<CHILD_FIELD>; addValue(value: ControlValueItem<FIELD>,
mustBeUnique?: boolean,
setAsDirty?: boolean,
emitEvent?: boolean): void; appendControl<CHILD_FIELD>(fieldTemplate?: string | CHILD_FIELD,
overrides?: Partial<CHILD_FIELD>): null | MFC<CHILD_FIELD>; appendControls<CHILD_FIELD>(fieldTemplates: string[] | CHILD_FIELD[]): MFC<CHILD_FIELD>[]; cleanup(): void; clear(resetChildren?: boolean): void; clearValue(setDirtyAs?: boolean,
resetChildren?: boolean,
origin?: boolean): void; deactivate(): void; disable(): void; dispatch(action: any,
setAsDirty?: boolean,
emitEvent?: boolean): Promise<void>; emitChange(name: ControlChangeName,
change: unknown,
origin?: MFC<any>): void; enable(): void; findControl<FIELD_TYPE, IDENTIFIER, _T>(identifier: IDENTIFIER): undefined | _T; get<VALUE>(key: OrString | (keyof MFC<MFGF<FieldParams>>
)): VALUE; getActiveSiblings<SIBLING_FIELD>(): MFC<SIBLING_FIELD>[]; getControl<FIELD_TYPE, IDENTIFIER, _T>(identifier: IDENTIFIER): ControlValue<FIELD> extends any[] ? undefined | _T : _T; getControls<FIELD>(states?: string | string[]): MFC<FIELD>[]; getFieldValue<OUTPUT>(key: keyof FIELD,
defaultValue?: OUTPUT): OUTPUT; getManager<MANAGER>(key: string): MANAGER; getOrAddControl<CHILD_FIELD>(field: CHILD_FIELD): MFC<CHILD_FIELD>; getPath(outcome?: | "controls" | "keys" | "default" | "uids"): ControlPath; getSibling<SIBLING_FIELD>(identifier: ControlIdentifier): MFC<SIBLING_FIELD>; getSiblings<SIBLING_FIELD>(): MFC<SIBLING_FIELD>[]; getState<T>(key: T): MargaritaFormState[T]; getStateChanges<T>(key: T): Observable<MargaritaFormState[T]>; hasControl(identifier: ControlIdentifier): boolean; moveToIndex(index: number): void; patchValue(value: undefined | null | Partial<VALUE>,
setAsDirty?: boolean,
emitEvent?: boolean): void; queryControls<RESULT_FIELD>(query: ((control: MFC<MFGF<FieldParams>>) => boolean),
recursive?: boolean): MFC<RESULT_FIELD>[]; registerResolver(key: string,
resolver: MargaritaFormResolver): void; registerValidator(key: string,
validator: MargaritaFormValidator): void; reInitialize(): void; remove(): void; removeValue(value: ControlValueItem<FIELD>,
setAsDirty?: boolean,
emitEvent?: boolean): void; reset(resetChildren?: boolean,
origin?: boolean): void; resetState(respectField?: boolean,
resetChildren?: boolean): void; resetValue(setDirtyAs?: boolean,
resetChildren?: boolean,
origin?: boolean): void; setField(field: FIELD,
resetControl?: boolean): Promise<void>; setRef(ref: any): void; setValue(value: undefined | null | VALUE,
setAsDirty?: boolean,
emitEvent?: boolean): void; submit<OUTPUT, PARAMS>(params?: PARAMS): Promise<OUTPUT>; toggleActive(): void; toggleEnabled(): void; toggleValue(value: ControlValueItem<FIELD>,
mustBeUnique?: boolean,
setAsDirty?: boolean,
emitEvent?: boolean): void; updateField(field: Partial<FIELD>,
resetControl?: boolean): Promise<void>; updateKey(): void; updateStateValue<T>(key: T,
value: MargaritaFormState[T]): Promise<boolean>; updateSyncId(): void; updateUid(): void; validate(setAsTouched?: boolean): Promise<boolean>; } Properties
updateState
updateState: (<T>(changes: T) => Promise<boolean>) Accessors
activeExtensions
- get activeExtensions(): ExtensionBase[]
Returns ExtensionBase[]
expectArray
- get expectArray(): boolean
Returns boolean
expectChildControls
- get expectChildControls(): boolean
Returns boolean
expectFlat
- get expectFlat(): boolean
Returns boolean
expectGroup
- get expectGroup(): boolean
Returns boolean
fieldChanges
- get fieldChanges(): Observable<FIELD>
Returns Observable<FIELD>
hasActiveControls
- get hasActiveControls(): boolean
Returns boolean
hasControls
- get hasControls(): boolean
Returns boolean
index
- get index(): number
Returns number
isDefaultValue
- get isDefaultValue(): boolean
Returns boolean
isInitialValue
- get isInitialValue(): boolean
Returns boolean
isRoot
- get isRoot(): boolean
Returns boolean
name
- get name(): FIELD["name"] extends string
? any[any]
: string Returns FIELD["name"] extends string
? any[any]
: string
value
- get value(): VALUE
- set value(value): void
Returns void
valueChanges
- get valueChanges(): Observable<VALUE>
Returns Observable<VALUE>
valueHash
- get valueHash(): string
Returns string
Methods
activate
- activate(): void
Returns void
addValue
- addValue(value, mustBeUnique?, setAsDirty?, emitEvent?): void
Parameters
- value: ControlValueItem<FIELD>
Optional
mustBeUnique: booleanOptional
setAsDirty: booleanOptional
emitEvent: boolean
Returns void
cleanup
- cleanup(): void
Returns void
clear
- clear(resetChildren?): void
Parameters
Optional
resetChildren: boolean
Returns void
clearValue
- clearValue(setDirtyAs?, resetChildren?, origin?): void
Parameters
Optional
setDirtyAs: booleanOptional
resetChildren: booleanOptional
origin: boolean
Returns void
deactivate
- deactivate(): void
Returns void
disable
- disable(): void
Returns void
dispatch
- dispatch(action, setAsDirty?, emitEvent?): Promise<void>
Parameters
- action: any
Optional
setAsDirty: booleanOptional
emitEvent: boolean
Returns Promise<void>
emitChange
- emitChange(name, change, origin?): void
Returns void
enable
- enable(): void
Returns void
getControls
- getControls<FIELD>(states?): MFC<FIELD>[]
Parameters
Optional
states: string | string[]
getPath
- getPath(outcome?): ControlPath
Parameters
Optional
outcome:
| "controls"
| "keys"
| "default"
| "uids"
hasControl
- hasControl(identifier): boolean
Returns boolean
moveToIndex
- moveToIndex(index): void
Returns void
patchValue
- patchValue(value, setAsDirty?, emitEvent?): void
Parameters
- value: undefined | null | Partial<VALUE>
Optional
setAsDirty: booleanOptional
emitEvent: boolean
Returns void
registerResolver
- registerResolver(key, resolver): void
Returns void
registerValidator
- registerValidator(key, validator): void
Returns void
reInitialize
- reInitialize(): void
Returns void
remove
- remove(): void
Returns void
removeValue
- removeValue(value, setAsDirty?, emitEvent?): void
Returns void
reset
- reset(resetChildren?, origin?): void
Parameters
Optional
resetChildren: booleanOptional
origin: boolean
Returns void
resetState
- resetState(respectField?, resetChildren?): void
Parameters
Optional
respectField: booleanOptional
resetChildren: boolean
Returns void
resetValue
- resetValue(setDirtyAs?, resetChildren?, origin?): void
Parameters
Optional
setDirtyAs: booleanOptional
resetChildren: booleanOptional
origin: boolean
Returns void
setField
- setField(field, resetControl?): Promise<void>
Parameters
- field: FIELD
Optional
resetControl: boolean
Returns Promise<void>
setRef
- setRef(ref): void
Returns void
setValue
- setValue(value, setAsDirty?, emitEvent?): void
Parameters
- value: undefined | null | VALUE
Optional
setAsDirty: booleanOptional
emitEvent: boolean
Returns void
toggleActive
- toggleActive(): void
Returns void
toggleEnabled
- toggleEnabled(): void
Returns void
toggleValue
- toggleValue(value, mustBeUnique?, setAsDirty?, emitEvent?): void
Parameters
- value: ControlValueItem<FIELD>
Optional
mustBeUnique: booleanOptional
setAsDirty: booleanOptional
emitEvent: boolean
Returns void
updateField
- updateField(field, resetControl?): Promise<void>
Parameters
- field: Partial<FIELD>
Optional
resetControl: boolean
Returns Promise<void>
updateKey
- updateKey(): void
Returns void
updateStateValue
- updateStateValue<T>(key, value): Promise<boolean>
Returns Promise<boolean>
updateSyncId
- updateSyncId(): void
Returns void
updateUid
- updateUid(): void
Returns void
validate
- validate(setAsTouched?): Promise<boolean>
Parameters
Optional
setAsTouched: boolean
Returns Promise<boolean>