Takes an array of KeyValueDifferFactory and returns a provider used to extend the inherited KeyValueDiffers instance with the provided factories and return a new KeyValueDiffers 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 KeyValueDiffer available.
Example
@Component(
viewProviders: const [
const KeyValueDiffers([new ImmutableMapDiffer()])
]
)
Source
static Provider extend(List<KeyValueDifferFactory> factories) { return new Provider(KeyValueDiffers, useFactory: (KeyValueDiffers parent) { if (parent == null) { // Typically would occur when calling KeyValueDiffers.extend inside of // dependencies passed to bootstrap(), which would override default // pipes instead of extending them. throw new BaseException( 'Cannot extend KeyValueDiffers without a parent injector'); } return KeyValueDiffers.create(factories, parent); }, deps: [ [KeyValueDiffers, new SkipSelf(), new Optional()] ]); }