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) Getting Started with Angular Review: Getting Started with Angular

Trying to figure out what I'm doing wrong....

Anyone have any pointers. I'm stuck on this one.

angular.module ("foobar", []); 
angular.module ('foobar')
.directive ('customDirective', function() {
  return {
    template: "this is a custom directive"
29,445 Points

If it's the same file you don't have to declare angular.module two times. Use the first one. Apart from that issue (which I doubt causes the problem) to debug what might be wrong we need to take a look at your HTML as well.

1 Answer

Multiple things. First you're using too much code. The template part isn't needed because you're just asked to console.log the string out. Also you're missing a exclamation point.

angular.module ("foobar", [])
.directive ('customDirective', function() {
    console.log("this is a custom directive!");

I just did over the challenge. The code above passes.

Mike Mitchell
Mike Mitchell
Courses Plus Student 27,026 Points

Thank you for explaining this. I just about threw Angular out the window.

Every time I got to the third part to this challenge, it said, "Oops. Stage 1 is no longer working." ARGH.

So the console.log doesn't need to be in the return?