I\'m fairly new to Javascript ( just finished the book Eloquent Javascript ), and am currently reading AngularJS from O\'Reilly. And getting this small snippet of code to w
Both previous answers are correct , just you should know that you can "override" the default behavior if you're declaring a controller this way:
module.controller("ControllerName",["$scope",function( custom_name ){ ... }]);
Example:
var app = angular.module("myApp",[]);
app.controller("TextController",["$scope",function(glue){
glue.name1 = "John";
glue.name2 = "Paul";
glue.name3 = "George";
glue.name4 = "Ringo";
}]);
and then:
Hello {{ name1 }}, {{ name2 }}, {{ name3 }}, {{ name4 }}!
Working here: http://jsfiddle.net/d4M2P/