Answer the question
In order to leave comments, you need to log in
How to create form elements based on a model?
I have a data model:
export class CustomBlockModel implements ICustomBlock {
public gettermethod: string;
public tag: string;
public type: string;
public value: any;
constructor(public block: ICustomBlock) {
this.gettermethod = block.gettermethod;
this.tag = block.tag;
this.type = block.type;
this.value = block.value;
}
}
for (let [key, value] of Object.entries(values)) {
if (key !== 'block') {
this._form.setControl(key, new FormControl(value));
}
}
if (key !== 'block') {}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question