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 trial

JavaScript AngularJS Basics (1.x) Controllers and Scope Creating controllers in Angular

I'm pretty sure i"m reading this completely wrong, but i'm confused as to what it is asking

some guidance would be awesome. I"m trying to add scope to a variable called someNumber with a value between one and five. Is this a range where I have to do math.random(), or is it me picking one number or am i completely off track?

app.js
angular.module('foobar', [])
.controller("coolCtrl",function($scope){
  var someNumber = $scope.value(4);
});

2 Answers

Jesse Zelaya
Jesse Zelaya
13,599 Points

This is what you're looking for

angular.module('foobar', [])
       .controller('coolCtrl', function($scope){
        $scope.someNumber = 4;
})

Why did you remove the final semicolon?

thank you so much! i knew i was making it harder than it had to be.

Jesse Zelaya
Jesse Zelaya
13,599 Points

Deanna O'Neal, it shouldn't be an issue for this challenge, but it is good practice to use semi-colons to prevent errors. Didn't notice I removed it. Thanks for catching that!