factory (factory.html)
Add a new service, defined by a factory function, to the package
Params
-
serviceFactoryOrName { function(),string } - If a string then this is the name of the service, otherwise it is assumed to be the
`serviceFactory`.
-
serviceFactory { function } - The factory function that will be used by the injector to create the service. The function must
not be anonymous - it must have a name, e.g. `function myService() { ... }` - since the name of
the service is taken from the name of the factory function.
Returns
{ Package } - "This" package, to allow methods to be chained.