IterableChanges

IterableChanges

Stable Interface

Interface Overview

interface IterableChanges {
  V 
  forEachItem(fn: (record: IterableChangeRecord<V>) => void) : void
  forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => 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
}

Interface Description

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

Interface Details

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

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

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

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

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.

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

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

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

Iterate over all added items.

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

Iterate over all moved items.

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

Iterate over all removed items.

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

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

exported from core-index, defined in core/src/change_detection/differs/iterable_differs.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/core/index/IterableChanges-interface.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部