Convert promise in JSON object

Viewed 68424

I have a problem converting the promise returned by the service to the controller. What I want is to create an array of JSON objects from the data contained in promise. Here is what I receive in the controller: Data received at controller

Here is the line that is used for printing that data:

console.log("controller unmatched: ", unmatched.getData(sFilter));

Here "unmatched" is the service, and getData() is its function.

Thanks!

4 Answers

if you want to get the JSON objects from the promise, I think you can use the below line of code

response.json()

Related