argos/dmp-frontend/src/app/models/registers/RegisterModel.ts

44 lines
1.2 KiB
TypeScript

import { Serializable } from '../Serializable';
import { ValidationContext } from '../../utilities/validators/ValidationContext';
import { FormGroup, FormBuilder } from '@angular/forms';
export class RegisterModel implements Serializable<RegisterModel> {
public abbreviation: String;
public definition: String;
public id: String;
public label: String;
public reference: String;
public uri: String;
constructor(abbreviation?: String, definition?: String, id?: String, label?: String, reference?: String, uri?: String) {
this.abbreviation = abbreviation;
this.definition = definition;
this.id = id;
this.label = label;
this.reference = reference;
this.uri = uri;
}
fromJSONObject(item: any): RegisterModel {
this.abbreviation = item.abbreviation;
this.definition = item.definition;
this.id = item.id;
this.label = item.label;
this.reference = item.reference;
this.uri = item.uri;
return this;
}
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
return new FormBuilder().group({
id: [this.id],
abbreviation: [this.abbreviation],
label: [this.label],
reference: [this.reference],
uri: [this.uri],
definition: [this.definition]
});
}
}