当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript KeyValueChanges.forEachChangedItem方法代码示例

本文整理汇总了TypeScript中@angular/core.KeyValueChanges.forEachChangedItem方法的典型用法代码示例。如果您正苦于以下问题:TypeScript KeyValueChanges.forEachChangedItem方法的具体用法?TypeScript KeyValueChanges.forEachChangedItem怎么用?TypeScript KeyValueChanges.forEachChangedItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/core.KeyValueChanges的用法示例。


在下文中一共展示了KeyValueChanges.forEachChangedItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

			this.zone.runOutsideAngular(() => {

				changes.forEachChangedItem((c) => {
					this.layersControl.removeLayer(c.previousValue);
					addFn.call(this.layersControl, c.currentValue, c.key);
					results.layersChanged++;
				});
				changes.forEachRemovedItem((c) => {
					this.layersControl.removeLayer(c.previousValue);
					results.layersRemoved++;
				});
				changes.forEachAddedItem((c) => {
					addFn.call(this.layersControl, c.currentValue, c.key);
					results.layersAdded++;
				});

			});
开发者ID:misteronak,项目名称:Verion-1.0-Donation-Dashboard,代码行数:17,代码来源:leaflet-control-layers.wrapper.ts

示例2: applyChanges

	private applyChanges(changes: KeyValueChanges<string, L.Layer>, addFn: (layer: L.Layer, name: string) => void): LeafletControlLayersChanges {
		let results: LeafletControlLayersChanges = new LeafletControlLayersChanges();

		if (null != changes) {

			changes.forEachChangedItem((c) => {
				this.layersControl.removeLayer(c.previousValue);
				addFn.call(this.layersControl, c.currentValue, c.key);
				results.layersChanged++;
			});
			changes.forEachRemovedItem((c) => {
				this.layersControl.removeLayer(c.currentValue);
				results.layersRemoved++;
			});
			changes.forEachAddedItem((c) => {
				addFn.call(this.layersControl, c.currentValue, c.key);
				results.layersAdded++;
			});

		}

		return results;
	}
开发者ID:misteronak,项目名称:Verion-1.0-Donation-Dashboard,代码行数:23,代码来源:leaflet-control-layers.wrapper.ts

示例3: _applyChanges

 private _applyChanges(changes: KeyValueChanges<string, string|number>): void {
   changes.forEachRemovedItem((record) => this._setStyle(record.key, null));
   changes.forEachAddedItem((record) => this._setStyle(record.key, record.currentValue));
   changes.forEachChangedItem((record) => this._setStyle(record.key, record.currentValue));
 }
开发者ID:IdeaBlade,项目名称:angular,代码行数:5,代码来源:ng_style.ts


注:本文中的@angular/core.KeyValueChanges.forEachChangedItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。