2018-10-05 17:00:54 +02: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 {
|
2018-10-05 17:00:54 +02:00
|
|
|
const formGroup = new FormBuilder().group({
|
|
|
|
firstName: [this.name],
|
|
|
|
lastName: [this.lastName]
|
|
|
|
});
|
|
|
|
|
|
|
|
return formGroup;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|