KeyValueDiffers
class
| npm Package | @angular/core |
|---|---|
| Module | import { KeyValueDiffers } from '@angular/core'; |
| Source | core/src/change_detection/differs/keyvalue_differs.ts |
Overview
class KeyValueDiffers {
constructor(factories: KeyValueDifferFactory[])
static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers
static extend<S>(factories: KeyValueDifferFactory[]): Provider
factories: KeyValueDifferFactory[]
find(kv: any): KeyValueDifferFactory
} Description
A repository of different Map diffing strategies used by NgClass, NgStyle, and others.
Static Members
static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers
static extend<S>(factories: KeyValueDifferFactory[]): Provider
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: [
KeyValueDiffers.extend([new ImmutableMapDiffer()])
]
}) Constructor
constructor(factories: KeyValueDifferFactory[])
Members
factories: KeyValueDifferFactory[]
find(kv: any): KeyValueDifferFactory
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v4.angular.io/api/core/KeyValueDiffers