W3cubDocs

/Angular

IterableDiffers

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

API

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

constructor

IterableDiffers
@paramfactoriesIterableDifferFactory[]
@returnsIterableDiffers

find

IterableDifferFactory
@paramiterableany

create

IterableDiffers
@paramfactoriesIterableDifferFactory[]
@paramparentIterableDiffers | undefined
@returnsIterableDiffers

extend

StaticProvider

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.

@paramfactoriesIterableDifferFactory[]
@returnsStaticProvider
Usage notes

Example

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.

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

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/IterableDiffers