I have the following code:
<select #categorySelect (change)="goToCategory.emit(categorySelect.value)" style="...">
<option selected hidden>All</option>
<option
[ngValue]="category"
*ngFor="let category of categories">
</option>
</select>
@Output() goToCategory = new EventEmitter<Category>();
I want to get the object category but I can only get a string 'object Object' which I can't properly transform back to the object. Is there a way to use native select and get the object element for the function in '(change)'?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/UVk9zZ7
Comments
Post a Comment