KeyValueDiffers

KeyValueDiffers

Stable Class

Class Overview

class KeyValueDiffers {
  static create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers) : KeyValueDiffers
  static extend(factories: KeyValueDifferFactory[]) : Provider
  constructor(factories: KeyValueDifferFactory[])
  
  
  factories : KeyValueDifferFactory[]
  find(kv: any) : KeyValueDifferFactory
}

Class Description

A repository of different Map diffing strategies used by NgClass, NgStyle, and others.

Constructor

constructor(factories: KeyValueDifferFactory[])

Static Members

create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers) : KeyValueDiffers
extend(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.

@Component({
  viewProviders: [
    KeyValueDiffers.extend([new ImmutableMapDiffer()])
  ]
})

Class Details

factories : KeyValueDifferFactory[]
find(kv: any) : KeyValueDifferFactory

exported from core-index, defined in core/src/change_detection/differs/keyvalue_differs.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/core/index/KeyValueDiffers-class.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部