the easies way in my eyes is to create a variable like
rowCount = [];
this is an array.
In your html you create an ngFor look where you iterate over the array and created a number of lines you have in your array.
addRow() is just pushing an item, what could be a model or so to the array. What will result as render of new line.
the ts code
criteriaFormArray = this.formBuilder.array()
....
private insertInFormArray(control: AbstractControl) {
this.criteriaFormArray.push(control);
}
the rendering
<div
formArrayName="criteria"
*ngFor="
let item of criteriaFormArray.controls;
let i = index;
let first = first;
let last = last
">....</div>
@Componentcontaining an@Output, and when this output emits, the parent component should then be able to add the new element to your collection.