I'm running into an issue when trying to access data from an array using the index.
This is the code snippet in my template:
<a href="#" class="...">{{ fixture.flatOdds.data[0].market_id }}</a>
However, this results in:
TypeError: fixture.flatOdds.data[0] is undefined
Despite the fact that fixture.flatOdds.data[0] is indeed defined. When I display fixture.flatOdds.data[0] like so:
<a href="#" class="...">{{ fixture.flatOdds.data[0] }}</a>
The object is printed correctly. The JSON response is as follows:
{ "bookmaker_id": 2, "bookmaker_event_id": null, "market_id": 1, "odds": [ { "label": "1", "value": 3, "winning": null, "handicap": null, "total": null, "last_update": { "date": "2018-07-29 08:15:53.000000", "timezone_type": 3, "timezone": "UTC" } }, { "label": "X", "value": 3.2, "winning": null, "handicap": null, "total": null, "last_update": { "date": "2018-07-29 08:15:53.000000", "timezone_type": 3, "timezone": "UTC" } }, { "label": "2", "value": 2.38, "winning": null, "handicap": null, "total": null, "last_update": { "date": "2018-07-29 08:15:53.000000", "timezone_type": 3, "timezone": "UTC" } } ] }
Any idea what could be causing this issue?
Note: I am fetching data from an API using axios.