Using Angular and Bootstrap 5, I have this HTML code of a form:
<div class="mb-3">
<label for="genreName"> Tür adı</label>
<div *ngIf="!enterTheGenre" class="form-group">
<select class="form-select">
<option [value]="genre.genreName" *ngFor="let genre of genres">
{{ genre.genreName }}
</option>
<option>Tür ekle</option>
</select>
</div>
ts file:
addBook() {
let bookModel:Book = Object.assign({}, this.bookAddForm.value);
}
But I can't get data from the form.
genreName data always null. I use select for genreName, but for others, I use input, so I can get data from input, but I can't get it from the form.
I changed value parameters like [value]="genre" but it didn't work.
