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 trialIla Gupta
5,147 PointsIn the body of the "coolController" callback function
In the body of the "coolController" callback function, attach a variable to $scope called someNumber with a value between 1 and 5.
if someone knows the answer?
My code:
angular.module ('foobar', [])
.controller ('coolCtrl' , function($scope)
{
$scope.coolController = function()
{
$scope.someNumber = '4';
};
});
I guess I am confused with the question.
Ila Gupta
5,147 PointsI removed it as string but do not get it by dropping $scope entirely. Could you elaborate? thanks!!
Samuel Gates
1,181 Points.controller('coolCtrl', function ($scope) { $scope.someNumber = 4; });
works. if not, you probably have an errant semi-colon or something.
Ila Gupta
5,147 PointsThanks this worked out. Sometimes the questions puzzle you up.
2 Answers
ellie adam
26,377 Pointsangular.module('foobar', [])
.controller("coolCtrl", function($scope){
$scope.someNumber = 4;
});
I solved it after 26 hours with help of Ken's hints.
Ila Gupta
5,147 PointsWell..this is the answer!!
Samuel Gates
1,181 PointsSamuel Gates
1,181 Pointsyeah, it confused me as well. you need to drop $scope.coolController entirely. also, i don't think you number should be a string (remove the quotes from '4').