當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.KeyValueDiffers類代碼示例

本文整理匯總了TypeScript中@angular/core.KeyValueDiffers的典型用法代碼示例。如果您正苦於以下問題:TypeScript KeyValueDiffers類的具體用法?TypeScript KeyValueDiffers怎麽用?TypeScript KeyValueDiffers使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了KeyValueDiffers類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

	constructor(leafletDirective: LeafletDirective, private differs: KeyValueDiffers, private zone: NgZone) {
		this.leafletDirective = new LeafletDirectiveWrapper(leafletDirective);
		this.controlLayers = new LeafletControlLayersWrapper(this.zone);

		// Generate differs
		this.baseLayersDiffer = this.differs.find({}).create<string, Layer>();
		this.overlaysDiffer = this.differs.find({}).create<string, Layer>();

	}
開發者ID:misteronak,項目名稱:Verion-1.0-Donation-Dashboard,代碼行數:9,代碼來源:leaflet-control-layers.directive.ts

示例2: constructor

 constructor(private dtRef:ChangeDetectorRef, private dtMetaDiffers:KeyValueDiffers) {
   this.dtConfig = DT_CONFIG_DEFAULTS;
   this.dtMetaDiffer = dtMetaDiffers.find({}).create(dtRef);
 }
開發者ID:ledge23,項目名稱:ng2-datatable,代碼行數:4,代碼來源:component.ts

示例3: constructor

 constructor(differs: KeyValueDiffers) {
     this.differ = differs.find([]).create(null);
     this.onRemove = new EventEmitter();
 }
開發者ID:clankford,項目名稱:angular2-sandbox,代碼行數:4,代碼來源:DoCheckItemComponent.ts

示例4: ngStyle

 @Input()
 set ngStyle(v: {[key: string]: string}) {
   this._ngStyle = v;
   if (!this._differ && v) {
     this._differ = this._differs.find(v).create(null);
   }
 }
開發者ID:AlmogShaul,項目名稱:angular,代碼行數:7,代碼來源:ng_style.ts

示例5: ngStyle

 @Input()
 set ngStyle(v: {[key: string]: string}) {
   this._ngStyle = v;
   if (isBlank(this._differ) && isPresent(v)) {
     this._differ = this._differs.find(this._ngStyle).create(null);
   }
 }
開發者ID:AngularLovers,項目名稱:angular,代碼行數:7,代碼來源:ng_style.ts

示例6: ngStyle

 @Input()
 set ngStyle(values: {[key: string]: string}) {
   this._ngStyle = values;
   if (!this._differ && values) {
     this._differ = this._differs.find(values).create();
   }
 }
開發者ID:KaneFreeman,項目名稱:angular,代碼行數:7,代碼來源:ng_style.ts

示例7: myUnless

	@Input() set myUnless(condition: boolean) {
		if (!condition) {
			this.viewContainer.createEmbeddedView(this.templateRef);
		} else {
			this.viewContainer.clear();
		}

		console.dir(this.differs.find(condition));
	}
開發者ID:training4developers,項目名稱:ng2prep,代碼行數:9,代碼來源:unless.ts

示例8: ngOnChanges

  ngOnChanges(changes: any): void {
    console.debug(this.constructor.name + '.ngOnChanges');

    if ('options' in changes) {
      const value = changes['options'].currentValue;
      if (!this._differ && value) {
        this._differ = this._differs.find(value).create();
      }
    }
  }
開發者ID:bradyhouse,項目名稱:house,代碼行數:10,代碼來源:ag-tree-grid.component.ts

示例9: ngStyle

 @Input()
 set ngStyle(
     /**
      * A map of style properties, specified as colon-separated
      * key-value pairs.
      * * The key is a style name, with an optional `.<unit>` suffix
      *    (such as 'top.px', 'font-style.em').
      * * The value is an expression to be evaluated.
      */
     values: {[key: string]: string}) {
   this._ngStyle = values;
   if (!this._differ && values) {
     this._differ = this._differs.find(values).create();
   }
 }
開發者ID:matsko,項目名稱:angular,代碼行數:15,代碼來源:ng_style.ts

示例10:

  transform<K, V>(
      input: null|{[key: string]: V, [key: number]: V}|Map<K, V>,
      compareFn: (a: KeyValue<K, V>, b: KeyValue<K, V>) => number = defaultComparator):
      Array<KeyValue<K, V>>|null {
    if (!input || (!(input instanceof Map) && typeof input !== 'object')) {
      return null;
    }

    if (!this.differ) {
      // make a differ for whatever type we've been passed in
      this.differ = this.differs.find(input).create();
    }

    const differChanges: KeyValueChanges<K, V>|null = this.differ.diff(input as any);

    if (differChanges) {
      this.keyValues = [];
      differChanges.forEachItem((r: KeyValueChangeRecord<K, V>) => {
        this.keyValues.push(makeKeyValuePair(r.key, r.currentValue !));
      });
      this.keyValues.sort(compareFn);
    }
    return this.keyValues;
  }
開發者ID:DeepanParikh,項目名稱:angular,代碼行數:24,代碼來源:keyvalue_pipe.ts


注:本文中的@angular/core.KeyValueDiffers類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。