auto.$provide.factory()

factory(name, $getFn);

Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.

Parameters

Param Type Details
name string

The name of the instance.

$getFn function()Array.<(string|function())>

The injectable $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).

Returns

Object

registered provider instance

doc_AngularJS
2016-03-29 16:11:04
Comments
Leave a Comment

Please login to continue.