简体   繁体   中英

How to get the data from the console output of API through Angular?

I am currently working on a full stack project using asp.net and angularjs.I have written this code to get output response from the Swagger API. ( https://i.stack.imgur.com/vLyIE.png ) I have done the API designing through ASP. Net. ( https://i.stack.imgur.com/DQkHS.png )

I want to know how I can fetch the details under "data". What should be the code for this?

Please help me with the code to display the details under "data" in the response ie, id, created Date etc.

I would define a variable that is equal to the response data as such

const data = successResponse.data;

then you could map over the data using data.map(val => { // do something with the value })

Or you could run a for loop, or execute the forEach method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM