Provider extend(List<IterableDifferFactory> factories)

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: const [
    IterableDiffers.extend(const [const ObservableListDiffFactory()])
  ]
)

Source

static Provider extend(List<IterableDifferFactory> factories) {
  return new Provider(IterableDiffers, useFactory: (IterableDiffers parent) {
    if (parent == null) {
      // Typically would occur when calling IterableDiffers.extend inside of
      // dependencies passed to bootstrap(), which would override default
      // pipes instead of extending them.
      throw new BaseException(
          "Cannot extend IterableDiffers without a parent injector");
    }
    return IterableDiffers.create(factories, parent);
  }, deps: [
    [IterableDiffers, new SkipSelf(), new Optional()]
  ]);
}