Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

KeyValueDiffer

A differ that tracks changes made to an object over time.

      
      interface KeyValueDiffer<K, V> {
diff(object: Map<K, V>): KeyValueChanges<K, V> | null
diff(object: { [key: string]: V; }): KeyValueChanges<string, V> | null }

Methods

Compute a difference between the previous state and the new object state.

      
      diff(object: Map<K, V>): KeyValueChanges<K, V> | null
    
Parameters
object Map<K, V>

containing the new value.

Returns

KeyValueChanges<K, V> | null: an object describing the difference. The return value is only valid until the next diff() invocation.

      
      diff(object: { [key: string]: V; }): KeyValueChanges<string, V> | null
    
Parameters
object object

containing the new value.

Returns

KeyValueChanges<string, V> | null: an object describing the difference. The return value is only valid until the next diff() invocation.