IterableDiffers

class

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

Overview

class IterableDiffers {
  constructor(factories: IterableDifferFactory[])
  static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers
  static extend(factories: IterableDifferFactory[]): Provider
  factories: IterableDifferFactory[]
  find(iterable: any): IterableDifferFactory
}

Description

A repository of different iterable diffing strategies used by NgFor, NgClass, and others.

Static Members

static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers

static extend(factories: IterableDifferFactory[]): Provider

Takes an array of IterableDifferFactory and returns a provider used to extend the inherited IterableDiffers instance with the provided factories and return a new IterableDiffers instance.

The following example shows how to extend an existing list of factories, which will only be applied to the injector for this component and its children. This step is all that's required to make a new IterableDiffer available.

Example

@Component({
  viewProviders: [
    IterableDiffers.extend([new ImmutableListDiffer()])
  ]
})

Constructor

constructor(factories: IterableDifferFactory[])

Members

factories: IterableDifferFactory[]

find(iterable: any): IterableDifferFactory

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v4.angular.io/api/core/IterableDiffers