repeat a div element after clicking closed

Using *ngFor you can loop over an array and display contents on the UI In the TS file

  isformes = true;
  formsArray = [""];
  DelBtn = delIndex => this.formsArray.splice(delIndex, 1);
  AddBtn = () => this.formsArray.push("");

HTML FILE

<ng-container *ngFor="let i of formsArray; let j = index">
    <div *ngIf="isformes">
      <!-- Other staffs here -->
   </div>
</ng-container>

See Sample Link

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top