Creating value Services

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'});

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.102.134