Я хочу отправить данные из поля ввода в компонент для извлечения последующих данных, если я связываю данные с атрибутом значения, он работает так, как я хочу, но я не могу отправить форму, так как значение, привязанное к значению, не являетсячто нужно на заднем конце.это мой пример кода
component.ts
fetchProductTypeForCategory(event) {
let category = event.srcElement.attributes.value || event.currentTarget.value;
this.productTypeSrv.fetchProductTypesParam(category)
.subscribe(res => {
this.productTypes = res;
}, err => {
console.log(err);
})
}
component.html
<select class="form-control" [formControl]="subCategoryForm.controls['l1category']" (change)="fetchProductTypeForCategory($event)">
<option *ngFor="let item of categorys" [value]="item.id">{{item.name}}</option>
<!-- <option *ngFor="let item of categorys" [value]="item.slug">{{item.name}}</option> --> // need this in order to submit the form
</select>
как я могупривязать item.id
к другому входному атрибуту и использовать его в моем (change)="fetchProductTypeForCategory($event)"
вызове?