Permalink
Browse files
docs($injector): fix inaccuracy in $provide.service docs
- Loading branch information
Showing
with
14 additions
and
2 deletions.
-
+14
−2
src/auto/injector.js
|
|
@@ -491,8 +491,20 @@ function annotate(fn, strictDi, name) { |
|
|
* |
|
|
* Register a **service constructor**, which will be invoked with `new` to create the service |
|
|
* instance. |
|
|
* This is short for registering a service where its provider's `$get` property is the service |
|
|
* constructor function that will be used to instantiate the service instance. |
|
|
* This is short for registering a service where its provider's `$get` property is a factory |
|
|
* function that returns an instance instantiated by the injector from the service constructor |
|
|
* function. |
|
|
* |
|
|
* Internally it looks a bit like this: |
|
|
* |
|
|
* ``` |
|
|
* { |
|
|
* $get: function() { |
|
|
* return $injector.instantiate(constructor); |
|
|
* } |
|
|
* } |
|
|
* ``` |
|
|
* |
|
|
* |
|
|
* You should use {@link auto.$provide#service $provide.service(class)} if you define your service |
|
|
* as a type/class. |
|
|
|