DefaultIterableDiffer

弃用说明

v4.0.0 - Should not be part of public API.

class DefaultIterableDiffer<V> implements IterableDiffer, IterableChanges{ constructor(trackByFn?: TrackByFunction<V>) get length: number get collection: V[] | Iterable<V> | null get isDirty: boolean forEachItem(fn: (record: IterableChangeRecord_<V>) => void) forEachOperation(fn: (item: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void) forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void) forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void) forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void) forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void) forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void) diff(collection: NgIterable<V>): DefaultIterableDiffer<V> | null onDestroy() check(collection: NgIterable<V>): boolean }

构造函数

constructor(trackByFn?: TrackByFunction<V>)

参数

trackByFn

Type: TrackByFunction.

可选. 默认值是 undefined.

属性

属性名类型说明
length只读
collection只读
isDirty只读

方法

forEachItem(fn: (record: IterableChangeRecord_<V>) => void)

参数

fn

Type: (record: IterableChangeRecord_) => void.

forEachOperation(fn: (item: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void)

参数

fn

Type: (item: IterableChangeRecord, previousIndex: number | null, currentIndex: number | null) => void.

forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void)

参数

fn

Type: (record: IterableChangeRecord_) => void.

forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void)

参数

fn

Type: (record: IterableChangeRecord_) => void.

forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void)

参数

fn

Type: (record: IterableChangeRecord_) => void.

forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void)

参数

fn

Type: (record: IterableChangeRecord_) => void.

forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void)

参数

fn

Type: (record: IterableChangeRecord_) => void.

diff(collection: NgIterable<V>): DefaultIterableDiffer<V> | null

参数

collection

Type: NgIterable.

返回值

DefaultIterableDiffer<V> | null

onDestroy()

参数

没有参数。

check(collection: NgIterable<V>): boolean

参数

collection

Type: NgIterable.

返回值

boolean