I am using httpClient to make an http call to an api and display the items in an ngfor. It seems to work cause I have three items being displayed in my list just as the three items being return from my api. However I can't seem to access the return json data. When I look at network call in the network tab in chrome I see a 200 success, but the response is html. I am guessing I need to specify the json data type somewhere, but I'm not sure.
Here is my http call in my service:
getProducts(): Observable<Product[]> {
return this.http.get<Product[]>(this.competitionUrl)
Here is how I am trying to consume the data in my component:
productlist = this.productdataservice.getProducts()
In my html:
<ion-list *ngFor="let product of productlist | async; let i = index">
<button ion-item>
<ion-avatar item-start>
<img src="../../assets/icon/favicon.png">
</ion-avatar>
<h2>{{product.productName}}</h2>
</button>
</ion-list>
My list displays three icons as it should because my api returns three products, but when I look at the network call from my angular front end page, I don't see the json data.