填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

IterableDiffer

用来跟踪一个迭代内的更改的策略。NgForOf使用它通过对 DOM 进行等效更改来响应此迭代内的更改。

A strategy for tracking changes over time to an iterable. Used by NgForOfto respond to changes in an iterable by effecting equivalent changes in the DOM.

      
      interface IterableDiffer<V> {
  diff(object: NgIterable<V>): IterableChanges<V> | null
}
    

方法

计算先前状态和新 object 状态之间的差异。

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

      
      diff(object: NgIterable<V>): IterableChanges<V> | null
    
参数
object NgIterable

包含新值。

containing the new value.

返回值

描述差异的对象。返回值仅在下一次 diff() 调用之前有效。

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