You use the very simple value
service to define a single value that you can inject as a service provider. The value
method uses the following syntax, where name
is the service name and object
is any JavaScript object you want to provide:
value(name, object)
For example:
var app = angular.module('myApp', []);
app.value('myValue', {color:'blue', value:'17'});