This commit is contained in:
Constantin Simonis 2024-12-03 08:24:55 +01:00
parent 676aae14af
commit fbc277cdef
No known key found for this signature in database
GPG key ID: 758DD9C506603183

View file

@ -46,11 +46,10 @@ import {TagComponent} from "./tag.component";
<br>
<button (click)="addTag()">+</button>
<div formArrayName="tags">
@for (tag of getTags().controls; track null) {
<br>
<input type="text" placeholder="tag" value="{{tag.value}}" formControlName="tagsControl">
<button (click)="deleteTag(tag)">-</button>
}
<div *ngFor="let tag of getTags().controls; let i = index">
<input type="text" placeholder="tag" [formControlName]="i">
<button (click)="deleteTag(tag)">-</button>
</div>
</div>
<br>
<br>
@ -76,6 +75,7 @@ export class EditHotelComponent implements OnInit {
tags.push(new FormControl(tag, [Validators.required]));
}
console.log(tags)
this.form = new FormGroup({
name: new FormControl(this.hotel?.hotelName, [Validators.required]),
description: new FormControl(this.hotel?.description, [Validators.required]),