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

KeyValueChanges

npm Package @angular/core
Module import { KeyValueChanges } from '@angular/core';
Source core/src/change_detection/differs/keyvalue_differs.ts

Interface Overview

      
      interface KeyValueChanges<K, V> { 
  forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
  forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
}
    

Description

An object describing the changes in the Map or {[k:string]: string} since last time KeyValueDiffer#diff() was invoked.

Members

      
      forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
    

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


      
      forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
    

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


      
      forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
    

Iterate over all keys for which values have changed.


      
      forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
    

Iterate over all added items.


      
      forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void
    

Iterate over all removed items.