Gostaria de pegar o valor do texto e não o 'value' do select.
<div class="form-group col-md-3">
<label for="ProductName">Product Name</label>
<select id="ProductName" class="form-control" formControlName='ProductName' autofocus #focusHere (change)="retrieveID()">
<option *ngFor="let productName of productNames" [value]="productName.id">{{ productName.ProductName }}</option>
</select>
<small *ngIf="productForm.get('ProductName').errors?.required" class="text-danger d-block mt-2">Product Name is
required!
</small>
</div>
Segue a lógica.
registerProduct() {
this.products.push({
ProductName: this.productForm.get('ProductName').value,
ProductElement: this.productForm.get('ProductElement').value,
ProductAttribute: this.productForm.get('ProductAttribute').value,
ProductAttributeValue: this.productForm.get('ProductAttributeValue').value,
Quantity: this.productForm.get('Quantity').value,
FK_ID_QUOTE: this.quote.id
})
this.productForm.reset()
this.focusHere.nativeElement.focus()
return this.products
}
Preciso pegar o valor do texto e o valor do value (id, nome).