import { FormGenerator } from '../interfaces/FormGenerator'; import { Serializable } from '../interfaces/Serializable'; import { FormGroup, FormBuilder } from '@angular/forms' export class ListingItem implements Serializable, FormGenerator{ public label: string; public value: string; fromJSONObject(item: any): ListingItem { this.label = item.label; this.value = item.value; return this; } buildForm(): FormGroup { return new FormBuilder().group({ label: [this.label], value: [this.value] }) } }