Skip to content
Advertisement

cannot access objects inside service response

When I tried to access the JSON response I cannot access the object.

I need to get the target and datapoint objects and after that I need to iterate the dataPoint array.

result.target is undefined in the above case.

Controller:

JavaScript

JSON response that I am receiving:

JavaScript

Advertisement

Answer

Response is an array, so you have to use an index.

Example

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement