24 lines
690 B
TypeScript
24 lines
690 B
TypeScript
|
import { BaseModel } from './BaseModel';
|
||
|
import { FormGroup } from '@angular/forms';
|
||
|
import { FormGenerator } from './interfaces/FormGenerator';
|
||
|
import { Serializable } from './interfaces/Serializable';
|
||
|
|
||
|
export class DefaultValue extends BaseModel implements Serializable<DefaultValue>, FormGenerator<FormGroup>{
|
||
|
public type: string;
|
||
|
public value: string;
|
||
|
|
||
|
fromJSONObject(item: any): DefaultValue {
|
||
|
this.type = item.type;
|
||
|
this.value = item.value;
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
buildForm(): FormGroup {
|
||
|
let formGroup = this.formBuilder.group({
|
||
|
type: [this.type],
|
||
|
value: [this.value]
|
||
|
|
||
|
});
|
||
|
return formGroup;
|
||
|
}
|
||
|
}
|