I have personInvolved component. This component has personDetails component. There is a button in personInvolved component. Onclick of the button I need to append the person
Use *ngFor:
*ngFor
<button (click)="addPerson()">Add person</button> <person-details *ngFor="let person of persons" [person]="person"></person-details>
And in the component code:
persons: Array<Person> = []; addPerson() { this.persons.push(new Person()); }