Headless CMS and Content Managment Hub
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.
 
 
 
 
 

29 lines
1.0 KiB

<div class="array-container" *ngIf="arrayControl.controls.length > 0"
[sqxSortModel]="arrayControl.controls"
(sqxSorted)="sort($event)">
<div class="item" *ngFor="let itemForm of arrayControl.controls; let i = index">
<sqx-array-item
[form]="form"
[field]="field"
[isHidden]="snapshot.isHidden"
[isFirst]="i === 0"
[isLast]="i === arrayControl.controls.length - 1"
[index]="i"
[itemForm]="itemForm"
[language]="language"
[languages]="languages"
(toggle)="hide($event)"
(moving)="move(itemForm, $event)"
(cloning)="addItem(itemForm)"
(removing)="removeItem(i)">
</sqx-array-item>
</div>
</div>
<button class="btn btn-success" [disabled]="field.nested.length === 0" (click)="addItem(undefined); $event.preventDefault()">
Add Item
</button>
<small class="text-muted ml-2" *ngIf="field.nested.length === 0">
Add a nested field first to add items.
</small>