Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript AngularJS Basics (1.x) Getting Started with Angular Review: Getting Started with Angular

Toni Dzalto
Toni Dzalto
21,667 Points

Challenge Task 2 of 3 Attach a custom directive called 'customDirective' to the module.

After task 1

angular.module('foobar', [])

I dont know how to pass task 2

i tried a lot of different ways including

angular.module('foobar', []) .customDirective();

but im not sure on this one, maybe sombody could explain.

2 Answers

Dustin McCaffree
Dustin McCaffree
14,310 Points

To pass Task 2:

angular.module('foobar', [])
.directive('customDirective', function() {

});

To pass Task 3, just follow the simple directions :)

Jake Lundberg
Jake Lundberg
13,965 Points

Check out the video, "Your first Angular Directive" around the 1:56 mark...it explains it there.