aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Minar2012-03-23 16:54:48 -0700
committerIgor Minar2012-03-23 16:54:48 -0700
commit4581b79bbda74de7f4abc136187fe5574892b39c (patch)
treeca3c2b62cb2e0f41a929a7e52c60f3010e38e035
parent2be8847ef6cdddcb98be9b57a2ca150065904fa1 (diff)
downloadangular.js-4581b79bbda74de7f4abc136187fe5574892b39c.tar.bz2
doc(guide/controller): fix examples
-rw-r--r--docs/content/guide/dev_guide.di.using_di_controllers.ngdoc17
1 files changed, 8 insertions, 9 deletions
diff --git a/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc b/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc
index 6f254eaa..6d1ff04b 100644
--- a/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc
+++ b/docs/content/guide/dev_guide.di.using_di_controllers.ngdoc
@@ -6,18 +6,17 @@ The most common place to use dependency injection in angular applications is in
dev_guide.mvc.understanding_controller controllers}. Here is a simple example:
<pre>
-function MyController($route){
- // configure the route service
- $route.when(...);
+function MyController($location){
+ // do stuff with the $location service
}
-MyController.$inject = ['$route'];
+MyController.$inject = ['$location'];
</pre>
In this example, the `MyController` constructor function takes one argument, the {@link
-api/angular.module.ng.$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, as follows:
+api/angular.module.ng.$location $location} service. Angular is then responsible for supplying the
+instance of `$location` to the controller when the constructor is instantiated. There are two ways
+to cause controller instantiation – by configuring routes with the `$location` service, or by
+referencing the controller from the HTML template, as follows:
<pre>
<!doctype html>
@@ -35,7 +34,7 @@ we have to supply this information to angular in the form of an additional prope
controller constructor function called `$inject`. Think of it as annotations for JavaScript.
<pre>
-MyController.$inject = ['$route'];
+MyController.$inject = ['$location'];
</pre>
The information in `$inject` is then used by the {@link api/angular.injector injector} to call the