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 trialAmitkumar Patel
6,699 PointsCreate an anonymous callback function as the second argument to the service method call.
This is what I have so far:
angular.module('foobar', [])
.service('myService'.click(function(){
Thank you for your assitance!
1 Answer
Steven Parker
231,269 PointsYou have a few odd things going on there:
- you only have one argument to service (there would be a comma to separate a second one)
- your argument seems to be an attempt to attach a click handler to a string (not valid)
- your service call and click handler function are both incomplete