aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPepper Lebeck-Jobe2011-03-20 21:49:06 -0700
committerIgor Minar2011-03-28 23:40:56 -0700
commit4da65d0e8c6a3bfbe5b2c4ad5708a39e750f739a (patch)
treec2b91e8f0c6435fa592302fa75b748865b23506c
parente1d122a4b7ba837997cd258939daf82310adc223 (diff)
downloadangular.js-4da65d0e8c6a3bfbe5b2c4ad5708a39e750f739a.tar.bz2
Fixes some links and types in the DI docs.
-rw-r--r--docs/guide.di.ngdoc12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/guide.di.ngdoc b/docs/guide.di.ngdoc
index 7c89c578..2d1f92eb 100644
--- a/docs/guide.di.ngdoc
+++ b/docs/guide.di.ngdoc
@@ -111,7 +111,7 @@ for isolation reasons. We get this isolation by having each test create its own
<pre>
// crate a root scope
var rootScope = angular.scope();
-// accesss the service loctor
+// accesss the service locator
var myService = rootScope.$service('myService');
</pre>
@@ -136,7 +136,7 @@ MyController.$inject = ['$route'];
</pre>
In this example, the `MyController` constructor function takes one argument, the
-(@link angular.service.$route $route) service. Angular is then responsible for supplying the
+{@link angular.service.$route $route} service. Angular is then responsible for supplying the
instance of `$route` to the controller when the constructor is instantiated. There are two ways to
cause controller instantiation – by configuring routes with the $route service or by referencing the
controller from the HTML template, such as:
@@ -260,8 +260,8 @@ rootScope.$service(greet, fnThis, 'world');
# Inferring `$inject`
-** EXPERIMENTAL: this is an experimental feature, see the important note at the end of this section
-for drawbacks. **
+**EXPERIMENTAL: this is an experimental feature, see the important note at the end of this section
+for drawbacks.**
We resort to `$inject` and our own annotation because there is no way in JavaScript to get a list of
arguments. Or is there? It turns out that calling `.toString()` on a function returns the function
@@ -286,7 +286,7 @@ fnA.$inject = ['$window', 'serviceA'];
// inject '$window', 'serviceA', curry 'name';
function fnB($window, serviceA_, name){};
-// implies: fnA.$inject = ['$window', 'serviceA'];
+// implies: fnB.$inject = ['$window', 'serviceA'];
</pre>
If angular does not find an `$inject` annotation on the function, then it calls the `.toString()`
@@ -301,4 +301,4 @@ and tries to infer what should be injected using the following rules:
Minifiers/obfuscators change the names of function arguments and will therefore break the `$inject`
inference. For this reason, either explicitly declare the `$inject` or do not use
minifiers/obfuscators. In the future, we may provide a pre-processor which will scan the source code
-and insert the `$inject` into the source code so that it can be minified/obfuscated. \ No newline at end of file
+and insert the `$inject` into the source code so that it can be minified/obfuscated.