本文整理匯總了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;
}
示例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;
}
示例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;
}
示例4: mapToObject
protected mapToObject(json): CatalogEntry {
return CatalogEntry.valueOf(json);
}