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

Matt Wing
Matt Wing
8,060 Points

Task 1 no longer processing on Create an Angular Service challenge

Hi all,

I'm hoping you can help me figure out what I need to change to make this work. I've gone back over the course videos a few times but haven't been able to track the problem down.

I'm working on the following code challenge: https://teamtreehouse.com/library/angular-basics/services-in-angular/create-an-angular-service

The code below passes the first two tasks just fine, but then the third task throws an error that task 1 is no longer passing.

angular.module('foobar', [])

.service('myService', function(callback){
    this.testingMyService = function(){
      console.log("This is my service!");
    };
  });

Task 1 OK: http://i.imgur.com/QSxbfug.png Task 3 Error: http://i.imgur.com/kjsY1L9.png

Does anyone have any ideas on what I might be doing wrong here?

Thanks.

1 Answer

Steven Parker
Steven Parker
231,271 Points

The message about task 1 is a bit misleading.

:point_right: The challenge is not expecting your service callback function to take an argument.

Matt Wing
Matt Wing
8,060 Points

Thanks for the tip! I removed the argument from the function and passed the challenge.