My Component's Search Function:
searchWithNyckel(){
const formData = new FormData();
formData.append('image', this.updateFormGroup.get('updateProduct.image').value);
this.productService.searchProductNyckel(formData).subscribe(
data => {
this.resForSearch= data
console.log(JSON.stringify(this.resForSearch));
// this.resForSearch.values()
}
)
}
My Service's Search Function:
searchProductNyckel(formData: FormData):Observable<SearchRes[]> {
const url = `https://www.nyckel.com/v0.9/functions/1wx5f2474e1ntc/search`
return this.httpClient.post<SearchRes[]>(url,formData);
}
The Result in the Console :
{
"searchSamples":
[{
"sampleId": "<sampleId>",
"distance": 0.86,
"externalId": "<externalId>"
}]
}
I WANT TO EXTRACT THE VALUES OF sampleId and distance