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

JavaScript AngularJS Basics (1.x) Services in Angular Review: get, delete, and save data with services

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 Points

"The $http.get method can take a callback as a parameter."

I said "False", and quiz says that is incorrect. I'm trying to understand why I'm wrong. In the example we just did, we didn't give it a callback as a parameter, we chained the ".then()" method which took our callback as a parameter.

Also, looking at the docs (https://docs.angularjs.org/api/ng/service/$http#get) it shows the .get method taking a url and optional config object.

Huston Hedinger

1 Answer

I agree, this question is not good for this section. I also got the wrong answer and went looking for clarification.

From what I can find, that optional "config" either can be or used to be an optional callback where you put an anonymous function.

See this older reference: https://teamtreehouse.com/community/now-in-the-httpget-call-pass-in-an-anonymous-function-as-a-callback-with-the-parameter-of-response-this-function-is