ENI Process Project Angular
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
2.0KB

  1. <div class="container">
  2. <div class="row">
  3. <div class="col-md-12">
  4. <div class="variableCal">
  5. <form [formGroup]="form" (ngSubmit)="onSubmit()">
  6. <div formArrayName="rows">
  7. <div *ngFor="let row of rows.controls; let rowIndex = index" [formGroupName]="rowIndex" class="row-section">
  8. <div formArrayName="columns" class="add-col-section">
  9. <div class="" *ngFor="let column of getColumns(row).controls; let colIndex = index" [formGroupName]="colIndex" class="column-section">
  10. <div class="form-group">
  11. <select formControlName="type" class="form-control">
  12. <option value="" selected disabled>--Select--</option>
  13. <option value="text">Text</option>
  14. <option value="variable">Variable</option>
  15. </select>
  16. </div>
  17. <div class="form-group" *ngIf="isText(row, colIndex)">
  18. <input type="text" formControlName="textValue" placeholder="Enter text" class="form-control"
  19. (change)="onParamChange($event, rowIndex, colIndex)"> <span> {{inputValue}} </span>
  20. </div>
  21. <div class="form-group" *ngIf="isVariable(row, colIndex)">
  22. <input formControlName="variableValue" class="form-control" placeholder="Enter variable">
  23. </div>
  24. </div>
  25. </div>
  26. <!-- Button to add a new column in the same row -->
  27. <button type="button" class="add-column-btn btn btn-success mt-0 " (click)="addColumn(rowIndex)">Add</button>
  28. </div>
  29. </div>
  30. <!-- Button to add a new row -->
  31. <button type="button" class="add-row-btn btn btn-secondary mr-2 mt-0" (click)="addRow()">Add</button>
  32. <button type="submit" class="submit-btn btn btn-success mt-0">Submit</button>
  33. </form>
  34. </div>
  35. </div>
  36. </div>
  37. </div>