fix
This commit is contained in:
parent
676aae14af
commit
fbc277cdef
1 changed files with 5 additions and 5 deletions
|
@ -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]),
|
||||
|
|
Loading…
Add table
Reference in a new issue