Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
I 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?
Ryan S27,276 Points
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.