本文整理汇总了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;
}
示例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);
}