Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

jlampstack
23,917 PointsI don't understand response.data @3:45
Instructor doesn't explain response.data, just simply plugs it in. Where is .data coming from? Is it a built-in Angular method? What is it's purpose?
2 Answers

Ryan S
27,275 PointsHi Jay,
When calling Angular's $http.get() method, the server will respond with a 'response' object, provided the request was successful.
This 'response' object has a few properties that you can access, one of which is "data". This data property will contain the data of the response, i.e., the JSON object that you had requested from the server.
Other properties of the response object are: config, headers, status, and statusText which can be accessed in the same way as the data.
Hope this clears things up.

olu adesina
23,007 Pointsthis is extremely helpful thanks @jaycode and ryan s
jlampstack
23,917 Pointsjlampstack
23,917 PointsThank you, was reading up on it. The response from the server is an object that has properties. data is just one of the properties it has. I've posted a link for more info and properties.
https://www.w3schools.com/angular/angular_http.asp