I know AngularJS has some Dependency Injection techniques. So if the code is and mainApp.value("defaultInput", 5); passes the data to the controller.
//define a module
var mainApp = angular.module("mainApp", []);
//create a value object as "defaultInput" and pass it a data.
mainApp.value("defaultInput", 5);
...
//inject the value in the controller using its name "defaultInput"
mainApp.controller('CalcController', function($scope, CalcService, defaultInput) {
$scope.number = defaultInput;
$scope.result = CalcService.square($scope.number);
$scope.square = function() {
$scope.result = CalcService.square($scope.number);
}
});
Why not just declare var defaultInput = 5 before the model definition? Why create a new syntactical sugar in AngularJS with value? Why create totally something new when you already have an option? Why complicate things?