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


TypeScript CatalogEntry.CatalogEntry类代码示例

本文整理汇总了TypeScript中app/catalog/CatalogEntry.CatalogEntry的典型用法代码示例。如果您正苦于以下问题:TypeScript CatalogEntry类的具体用法?TypeScript CatalogEntry怎么用?TypeScript CatalogEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: valueOf

	public static valueOf(data: any): Notification {
		let notification = new Notification();
		notification.id = data.id;
		notification.type = CatalogEntry.valueOf(data.type);
		notification.repetitionType = data.repetitionType;
		notification.repetitionParameter = data.repetitionParameter;
		notification.nextDistance = data.nextDistance;
		notification.message = data.message;
		notification.created = new Date(data.created);
		notification.active = data.active;

		return notification;
	}
开发者ID:freekode,项目名称:bikelife,代码行数:13,代码来源:Notification.ts

示例2: valueOf

	public static valueOf(data: any): BikePart {
		let bikePart = new BikePart();
		bikePart.id = data.id;
		bikePart.brand = data.brand;
		bikePart.model = data.model;
		bikePart.weight = data.weight;
		bikePart.notes = data.notes;
		bikePart.active = data.active;
		bikePart.distance = data.distance;
		bikePart.type = data.type ? CatalogEntry.valueOf(data.type) : undefined;
		bikePart.intervals = data.intervals ? data.intervals.map(data => Interval.valueOf(data)) : [];
		bikePart.lastInterval = data.lastInterval ? Interval.valueOf(data.lastInterval) : undefined;
		bikePart.bike = data.bike ? Bike.valueOf(data.bike) : undefined;

		return bikePart;
	}
开发者ID:freekode,项目名称:bikelife,代码行数:16,代码来源:BikePart.ts

示例3: valueOf

	public static valueOf(data: any): Bike {
		let bike = new Bike();

		bike.id = data.id;
		bike.created = data.created ? new Date(data.created) : undefined;
		bike.brand = data.brand;
		bike.model = data.model;
		bike.notes = data.notes;
		bike.active = data.active;
		bike.distance = data.distance;
		bike.weight = data.weight;
		bike.stravaGearId = data.stravaGearId;
		bike.type = data.type ? CatalogEntry.valueOf(data.type) : undefined;
		bike.components = data.components ? data.components.map(data => BikePart.valueOf(data)) : [];

		return bike;
	}
开发者ID:freekode,项目名称:bikelife,代码行数:17,代码来源:Bike.ts

示例4: mapToObject

	protected mapToObject(json): CatalogEntry {
		return CatalogEntry.valueOf(json);
	}
开发者ID:freekode,项目名称:bikelife,代码行数:3,代码来源:CatalogResource.ts


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