It looks like the issue with the code has more to do with variable scoping, so I baked up this quick scope tutorial.
Now, moving into the JavaScript world from C#, the concept of scope can be very tricky. Block scope is not the norm (yet), as I can see you're well aware of from your self assignment. What Angular does is try to prop up the concept of block scope within specific blocks with use of the $scope provider.
Now, there are several different flavors of scope in Angular. The one you should be working with most often is the basic $scope, and it is regularly used in controllers, like so:
myApp.controller('someAwesomeController',['$scope',function($scope){
$scope.message = 'Hello World!';
}]);
In the HTML, {{message}} is now available as a variable within someAwesomeController's perimeter.
You'll notice the Angular Dependency Injection, that's necessary to use the $scope provider, and thus make items available on the view. You can name the variable whatever you want within the function parameters, as long as the string portion is right. The parameters evaluate in order of declaration, and this is all to keep minification from breaking the code. For instance:
myApp.controller('someAwesomeController',['$scope','$route',function(s,r){
s.message = 'Hello World!';
}]);
A controller scope will also have access to any controller scope that is is nested within. For instance:
<script type="text/javascript">
myApp.controller('outer',['$scope',function($scope){ $scope.outer = 'Hello';}])
.controller('inner',['$scope',function($scope){ $scope.inner = 'World'; }]);
</script>
<div ng-controller="outer">
<p>{{outer}}</p> <!--
<div ng-controller="inner">
<p>{{outer}} {{inner}}</p> <!--
</div>
<p>{{inner}}</p> <!--
</div>
Finally, 2 other concepts that you should be aware of are $rootScope and isolated scope.
Root Scope is basically a big global namespace that all $scope can access. Best practice is to use it sparingly.
Isolated scope is common in directives, and will not make the $scope of containing controllers available.
My wall-o-text not withstanding, I hope this helps you with your project. You can read more about Angular scope at:
https://docs.angularjs.org/guide/scope[
^]