W3cubDocs

/Angular 12

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

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_) => void

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

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

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

Parameters
fn (record: IterableChangeRecord_) => void

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

Parameters
fn (record: IterableChangeRecord_) => void

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

Parameters
fn (record: IterableChangeRecord_) => void

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

Parameters
fn (record: IterableChangeRecord_) => void

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

Parameters
fn (record: IterableChangeRecord_) => void

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

Parameters
collection NgIterable
Returns

DefaultIterableDiffer<V> | null

onDestroy()

Parameters

There are no parameters.

check(collection: NgIterable<V>): boolean

Parameters
collection NgIterable
Returns

boolean

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