Components/create-edit-modal: make first image mandatory
This commit is contained in:
parent
f839706d05
commit
455e2869a5
2 changed files with 7 additions and 2 deletions
|
|
@ -40,8 +40,11 @@
|
||||||
<input formControlName="{{$index}}" type="text" class="form-control" placeholder="">
|
<input formControlName="{{$index}}" type="text" class="form-control" placeholder="">
|
||||||
<label class="form-label">Image {{ $index + 1 }} URL</label>
|
<label class="form-label">Image {{ $index + 1 }} URL</label>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-outline-danger" (click)="removeImageControl($index)"><i
|
@if (!$first) {
|
||||||
class="bi bi-x-lg"></i></button>
|
<button type="button" class="btn btn-outline-danger" (click)="removeImageControl($index)">
|
||||||
|
<i class="bi bi-x-lg"></i>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ export class CreateEditModalComponent {
|
||||||
description: new FormControl(this.show?.description, Validators.required),
|
description: new FormControl(this.show?.description, Validators.required),
|
||||||
images: new FormArray([])
|
images: new FormArray([])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.addImageControl()
|
||||||
}
|
}
|
||||||
|
|
||||||
get images(): FormArray {
|
get images(): FormArray {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue