import { FormGroup } from "@angular/forms"; import { Rule } from "../../../../core/model/admin/dataset-profile/dataset-profile"; import { BaseFormModel } from "../../../../core/model/base-form-model"; export class RuleEditorModel extends BaseFormModel { public target: string; public value: string; public ruleType: string; public ruleStyle: string; public valueType: string; fromModel(item: Rule): RuleEditorModel { this.target = item.target; this.value = item.value; this.ruleType = item.ruleType; this.ruleStyle = item.ruleStyle; this.valueType = item.valueType; return this; } buildForm(): FormGroup { const formGroup = this.formBuilder.group({ // sourceField: [this.sourceField], target: [this.target], ruleStyle: [this.ruleStyle], value: [this.value], ruleType: [this.ruleType], valueType: [this.valueType] }); return formGroup; } }