Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2632250

Browse files
alirezamirianpetebacondarwin
authored andcommitted
docs($injector): fix inaccuracy in $provide.service docs
Closes #12664 Closes #12665
1 parent fdbd92f commit 2632250

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/auto/injector.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,20 @@ function annotate(fn, strictDi, name) {
487487
*
488488
* Register a **service constructor**, which will be invoked with `new` to create the service
489489
* instance.
490-
* This is short for registering a service where its provider's `$get` property is the service
491-
* constructor function that will be used to instantiate the service instance.
490+
* This is short for registering a service where its provider's `$get` property is a factory
491+
* function that returns an instance instantiated by the injector from the service constructor
492+
* function.
493+
*
494+
* Internally it looks a bit like this:
495+
*
496+
* ```
497+
* {
498+
* $get: function() {
499+
* return $injector.instantiate(constructor);
500+
* }
501+
* }
502+
* ```
503+
*
492504
*
493505
* You should use {@link auto.$provide#service $provide.service(class)} if you define your service
494506
* as a type/class.

0 commit comments

Comments
 (0)