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 trialDawn Triplett
17,000 PointsTrying to create a new controller
Trying to create a new controller. I've tried: .controller('coolCtrl'); then .controller('coolCtrl', function($scope) {});
Neither worked. Been stuck all day. Any help is appreciated!
angular.module('foobar', []);
.controller('coolCtrl');
1 Answer
Lukas Dahlberg
53,736 PointsYou have a semicolon between the module and the controller. The two must be connected: angular.module().controller()...
Dawn Triplett
17,000 PointsThanks. I just fiqured it out. Makes sense that it needs to be connected.
Answer: angular.module('foobar', []).controller('coolCtrl');
Dawn Triplett
17,000 PointsDawn Triplett
17,000 PointsThe Challenge is: Create new controller called "coolCtrl".