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 trialJoe Hochgreve
Courses Plus Student 2,110 PointsI am able to pass task 1 but it does not seem to like my 'customDirective' no matter how I add it.
Here is how I have done it:
angular.module('foobar', []) .directive('customDirective');
I cant seem to sort out where I am going wrong.
angular.module('foobar', [])
.directive('customDirective');
2 Answers
Justin Horner
Treehouse Guest TeacherHello Joe,
When you make a directive in Angular you must provide two parameters: the name of the directive and the function callback that Angular will invoke when the directive is instantiated by Angular. Try modifying your code as follows.
angular.module('foobar', [])
.directive('customDirective', function() {});
I hope this helps.
Joe Hochgreve
Courses Plus Student 2,110 PointsOk I see so even if the function is empty the simple requirement is 2 params regardless. Makes sense!
Justin Horner
Treehouse Guest TeacherYeah, exactly!