A service is created by a service factory and service factories
are functions which are created by a service provider(constructor
function).
When we talk about registering a service
using value, here value is nothing more than a simple injectable
value. The value can be a string, number, array, function, object.
The difference between value and constant is, it can not be injected
into configuration. It accepts two parameters, that are: name and
value. Syntax is:
You can ask technology related questions at FindNerd Forum section. Mostly questions asked from the community Java, Androip, PHP and JavaScript forums.
When instantiating service provider, there must be a property
named $get, which holds service factory logic.
The $provide provide helping method for registering services with the help of $injector.
The $provide provide helping method for registering services with the help of $injector.
value(name, value);For full Blog about Registering Service using value in angularJS visit FindNerd.
You can ask technology related questions at FindNerd Forum section. Mostly questions asked from the community Java, Androip, PHP and JavaScript forums.
No comments:
Post a Comment