I am trying to specify multiple values on the same module, but I cannot succeed. Is there something wrong with my code?
mod = angular.module("services", []);
mod.value("message","text1");
mod.value("message2","text2");
When I reference message in the HTML page it works, but when I try to use message2 it doesn't. What's happening?
EDIT: It worked when I changed the controller from
angular.module("root",["services"])
.controller("index", ["$scope", "message", function($scope, message){
$scope.message = message;
}]);
to
angular.module("root",["services"])
.controller("index", ["$scope", "message", function($scope, message){
$scope.message = message;
}])
.controller("index2", ["$scope", "message2", function($scope, message2){
$scope.message2 = message2;
}]);