• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript core.KeyValueDiffers类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript core.NgModuleFactory类代码示例发布时间:2022-05-28
下一篇:
TypeScript core.KeyValueDiffer类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap