28 lines
1.3 KiB
HTML
28 lines
1.3 KiB
HTML
<div class="container">
|
|
<div style="background-color: #f5f5f5;border: 1px solid #e3e3e3;padding: 24px;">
|
|
<form novalidate [formGroup]="form" (ngSubmit)="onSubmit()">
|
|
<div *ngFor="let section of dataModel.sections; let i=index;">
|
|
<h4 style="text-decoration: underline;">Section
|
|
<button type="button" class="btn btn-sm" style="margin-left:5px;" (click)="DeleteSection(i);">
|
|
<span class="glyphicon glyphicon-erase"></span>
|
|
</button>
|
|
</h4>
|
|
<section-form [form]="form.get('sections').get(''+i)" [dataModel]="section" [index]="i"></section-form>
|
|
<div style="margin-top:20px; padding-left: 15px;">
|
|
<a (click)="addSection()" style="cursor: pointer">
|
|
Add another section +
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div *ngIf="dataModel.sections.length == 0;" style="margin-top:20px; padding-left: 15px;">
|
|
<a (click)="addSection()" style="cursor: pointer">
|
|
Add another section +
|
|
</a>
|
|
</div>
|
|
|
|
<button type="submit">Save</button>
|
|
|
|
<p>Form value: {{ form.value | json }}</p>
|
|
</form>
|
|
</div>
|
|
</div> |