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 trialJorge Borge
1,526 PointsHelp not sure what I am doing wrong
I am suppose to create a new controller called 'coolCtrl'. What am i doing wrong?
angular.module('foobar', []); .controller('coolCtrl') {
});
6 Answers
Ary de Oliveira
28,298 Pointsangular.module('foobar', []).controller('coolCtrl');
Adam Bodie
34,341 PointsFor the sake of first exercise, only the 'coolCtrl' parameter is needed for the controller method, so the answer is actually
angular.module('foobar', []).controller('coolCtrl');
The curly brackets are part of the controller method's second parameter, the anonymous function, which is skipping ahead of the first question.
Bradley Maravalli
8,927 PointsThis worked! Thank you!
Adam Bodie
34,341 PointsYou have an unneeded semicolon after the module method. Just remove it and it will work
angular.module('foobar', []).controller('coolCtrl') {
});
Jorge Borge
1,526 PointsI tried your answer it didn't work :/
Gonzalo Calderon
21,653 PointsIn the second parameter of the "coolCtrl" create an anonymous callback function that takes $scope as a parameter.
Maldon Meehan
4,952 Pointsangular.module('foobar', []).controller('coolCtrl', function($scope){});