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


TypeScript CatalogEntry.valueOf方法代碼示例

本文整理匯總了TypeScript中app/catalog/CatalogEntry.CatalogEntry.valueOf方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript CatalogEntry.valueOf方法的具體用法?TypeScript CatalogEntry.valueOf怎麽用?TypeScript CatalogEntry.valueOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app/catalog/CatalogEntry.CatalogEntry的用法示例。


在下文中一共展示了CatalogEntry.valueOf方法的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.valueOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。