This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

IterableChanges

An object describing the changes in the Iterable collection since last time IterableDiffer#diff() was invoked.

      
      interface IterableChanges<V> {
  forEachItem(fn: (record: IterableChangeRecord<V>) => void): void
  forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void
  forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void
  forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void
  forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void
  forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void
  forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void
}
    

Class implementations

Methods

Iterate over all changes. IterableChangeRecord will contain information about changes to each item.

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

Parameters

fn

Type: (record: IterableChangeRecord) => void.

Returns

void

Iterate over a set of operations which when applied to the original Iterable will produce the new Iterable.

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

Parameters

fn

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

Returns

void

NOTE: These are not necessarily the actual operations which were applied to the original Iterable, rather these are a set of computed operations which may not be the same as the ones applied.

Iterate over changes in the order of original Iterable showing where the original items have moved.

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

Parameters

fn

Type: (record: IterableChangeRecord) => void.

Returns

void

Iterate over all added items.

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

Parameters

fn

Type: (record: IterableChangeRecord) => void.

Returns

void

Iterate over all moved items.

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

Parameters

fn

Type: (record: IterableChangeRecord) => void.

Returns

void

Iterate over all removed items.

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

Parameters

fn

Type: (record: IterableChangeRecord) => void.

Returns

void

Iterate over all items which had their identity (as computed by the TrackByFunction) changed.

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

Parameters

fn

Type: (record: IterableChangeRecord) => void.

Returns

void