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 trialBryan Bartels
2,377 PointsTrying 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"
};
});
1 Answer
David Tonge
Courses Plus Student 45,640 PointsMultiple 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
Courses Plus Student 27,026 PointsThank 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?
akak
29,445 Pointsakak
29,445 PointsIf 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.