Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FormModel<Children>

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

  • new FormModel(children: Children): FormModel

Properties

[FORM_ID]

[FORM_ID]: boolean
internal

[MODEL_ID]

[MODEL_ID]: boolean
internal

[SET_ID]

[SET_ID]: boolean
internal

childRegister$

childRegister$: Subject<string> = new Subject<string>()

childRemove$

childRemove$: Subject<string> = new Subject<string>()

children

children: Children

destroyOnUnmount

destroyOnUnmount: boolean = false

组件 unmount 的时候删除 model

error$

error$: BehaviorSubject<undefined | null | IValidateResult<Value>> = new BehaviorSubject<IMaybeError<Value>>(null)

id

id: string

initialValue

initialValue: Maybe<$FieldSetValue<Children>> = None()
internal

初始值

isValidating$

isValidating$: BehaviorSubject<boolean> = new BehaviorSubject(false)

patchedValue

patchedValue: $FieldSetValue<Children> | null = null
internal

phantomValue

phantomValue: $FieldSetValue<Children>
internal

validate$

validate$: Subject<IValidation> = new Subject<IValidation>()
internal

validators

validators: IValidators<$FieldSetValue<Children>> = []
internal

校验规则数组

Private workingValidators

workingValidators: Set<Observable<unknown>> = new Set<Observable<unknown>>()
internal

Accessors

error

form

owner

Methods

addWorkingValidator

  • addWorkingValidator(v: Observable<unknown>): void

clear

  • clear(): void

dirty

  • dirty(): boolean

dispose

  • dispose(): void

get

  • get<Name>(name: Name): Children[Name] | undefined | null
  • 返回指定字段名对应的 model

    Type parameters

    • Name: keyof Children

    Parameters

    • name: Name

      字段名

    Returns Children[Name] | undefined | null

getPatchedValue

  • getPatchedValue<T>(name: string): Maybe<T>

getRawValue

getSubmitValue

  • getSubmitValue(): any

initialize

patchValue

pristine

  • pristine(): boolean

registerChild

  • registerChild(name: string, model: BasicModel<any>): void

removeChild

removeWorkingValidator

  • removeWorkingValidator(v: Observable<unknown>): void

reset

  • reset(): void

touched

  • touched(): boolean

Protected triggerValidate

Private updateIsValidating

  • updateIsValidating(): void

valid

  • valid(): boolean

validate

Generated using TypeDoc