W3cubDocs

/Angular

DefaultIterableDiffer

class deprecated final

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

class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {
  constructor(trackByFn?: TrackByFunction<V>)
  length: number
  collection: V[] | Iterable<V> | null
  isDirty: boolean
  forEachItem(fn: (record: IterableChangeRecord_<V>) => void)
  forEachOperation(fn: (item: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => 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

constructor(trackByFn?: TrackByFunction<V>)

Parameters
trackByFn TrackByFunction<V>

Optional. Default is undefined.

Properties

Property Description
length: number Read-Only
collection: V[] | Iterable<V> | null Read-Only
isDirty: boolean Read-Only

Methods

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

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

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

Parameters
fn (item: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => void

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

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

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

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

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

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

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

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

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

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

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

Parameters
collection NgIterable<V>
Returns

DefaultIterableDiffer<V> | null

onDestroy()

Parameters

There are no parameters.

check(collection: NgIterable<V>): boolean

Parameters
collection NgIterable<V>
Returns

boolean

© 2010–2023 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/core/DefaultIterableDiffer