added templates component
This commit is contained in:
@ -17,6 +17,7 @@ export class SampleModel extends BaseModel {
|
||||
note_id: IdModel = null;
|
||||
user_id: IdModel = null;
|
||||
notes: {comment: string, sample_references: {sample_id: IdModel, relation: string}[], custom_fields: {[prop: string]: string}} = {comment: '', sample_references: [], custom_fields: {}};
|
||||
added: Date = null;
|
||||
|
||||
deserialize(input: any): this {
|
||||
Object.assign(this, input);
|
||||
@ -27,6 +28,9 @@ export class SampleModel extends BaseModel {
|
||||
if (input.hasOwnProperty('measurements')) {
|
||||
this.measurements = input.measurements.map(e => new MeasurementModel().deserialize(e));
|
||||
}
|
||||
if (input.hasOwnProperty('added')) {
|
||||
this.added = new Date(input.added);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import {BaseModel} from './base.model';
|
||||
export class TemplateModel extends BaseModel {
|
||||
_id: IdModel = null;
|
||||
name = '';
|
||||
version = 1;
|
||||
parameters: {name: string, range: {[prop: string]: any}}[] = [];
|
||||
version = 0;
|
||||
first_id: IdModel = null;
|
||||
parameters: {name: string, range: {[prop: string]: any}, rangeString?: string}[] = [];
|
||||
}
|
||||
|
Reference in New Issue
Block a user