argos/dmp-frontend/src/app/models/researcher/ResearcherModel.ts

29 lines
656 B
TypeScript
Raw Normal View History

2017-12-19 08:31:02 +01:00
import { Serializable } from "../Serializable";
2018-02-05 10:44:40 +01:00
import { FormGroup, FormBuilder } from '@angular/forms';
2017-12-19 08:31:02 +01:00
export class ResearcherModel implements Serializable<ResearcherModel> {
public id: String;
2017-12-20 14:34:32 +01:00
public name: String;
2018-02-05 10:44:40 +01:00
public lastName: String;
2017-12-19 08:31:02 +01:00
public uri: String;
public email: String;
fromJSONObject(item: any): ResearcherModel {
this.id = item.id;
2017-12-20 14:34:32 +01:00
this.name = item.name;
2017-12-19 08:31:02 +01:00
this.email = item.email;
this.uri = item.uri;
return this;
}
2018-02-05 10:44:40 +01:00
buildForm(): FormGroup {
let formGroup = new FormBuilder().group({
firstName:[this.name],
lastName:[this.lastName]
})
return formGroup;
}
2017-12-19 08:31:02 +01:00
}