Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FieldArrayModel<Item, Child>

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

[FIELD_ARRAY_ID]

[FIELD_ARRAY_ID]: boolean
internal

[MODEL_ID]

[MODEL_ID]: boolean
internal

Private childFactory

childFactory: function

Type declaration

    • (defaultValue: Item): Child
    • Parameters

      • defaultValue: Item

      Returns Child

children$

children$: BehaviorSubject<Child[]>

Private defaultValue

defaultValue: keyof Item[]

destroyOnUnmount

destroyOnUnmount: boolean = false

组件 unmount 的时候删除 model

error$

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

id

id: string

initialValue

initialValue: Maybe<keyof Item[]> = None()
internal

初始值

owner

owner: IModel<any> | null = null

phantomValue

phantomValue: keyof Item[]
internal

validate$

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

validators

validators: IValidators<keyof Item[]> = []
internal

校验规则数组

Accessors

children

  • get children(): Child[]

error

form

  • get form(): undefined | null | FormModel<any>

Methods

clear

  • clear(): void

dirty

  • dirty(): boolean

dispose

  • dispose(): void

getRawValue

  • getRawValue(): (null | Item)[]

getSubmitValue

  • getSubmitValue(): (null | Item)[]

initialize

  • initialize(values: Item[]): void

patchValue

  • patchValue(value: Item[]): void

pop

  • pop(): undefined | Child

pristine

  • pristine(): boolean

push

  • push(...items: Item[]): void
  • 添加一批元素到 FieldArray 的末尾

    Parameters

    • Rest ...items: Item[]

      待添加的值

    Returns void

reset

  • reset(): void

shift

  • shift(): undefined | Child

splice

  • splice(start: number, deleteCount?: number, ...items: keyof Item[]): Child[]
  • FieldArray 的指定位置删除指定数量的元素,并添加指定的新元素

    Parameters

    • start: number

      开始删除的元素位置

    • Default value deleteCount: number = 0

      删除的元素个数

    • Rest ...items: keyof Item[]

      待添加的元素值

    Returns Child[]

touched

  • touched(): boolean

Protected triggerValidate

unshift

  • unshift(...items: Item[]): void
  • FieldArray 开头添加值

    Parameters

    • Rest ...items: Item[]

      待添加的值·

    Returns void

valid

  • valid(): boolean

validate

Generated using TypeDoc