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 trialMaximiliano Campos
1,080 PointsError when i use the directive "<todo>"
When i use the directive <todo> i got this error: Error: [ng:areq] http://errors.angularjs.org/1.3.14/ng/areq?p0=mainCtrl&p1=not%20a%20function%2C%20got%20undefined
I have the code exactly equal that the video.
1 Answer
Laurie Brown
21,103 PointsWorks for me. Looks like it's having trouble finding the controller and yes, the directive name should be plural in your index.html file: Does your todos.js look like:
angular.module('todoListApp') .directive('todos', function() { return { templateUrl: 'templates/todos.html', controller: 'mainCtrl' } })
Hope that helps.
Ian Lunn
4,558 PointsIan Lunn
4,558 PointsI believe the directive name is todos (with an 's').