aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/guide/di.ngdoc
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/guide/di.ngdoc')
-rw-r--r--docs/content/guide/di.ngdoc11
1 files changed, 5 insertions, 6 deletions
diff --git a/docs/content/guide/di.ngdoc b/docs/content/guide/di.ngdoc
index a9280103..75d016b6 100644
--- a/docs/content/guide/di.ngdoc
+++ b/docs/content/guide/di.ngdoc
@@ -196,14 +196,13 @@ Controllers are classes which are responsible for application behavior. The reco
declaring controllers is:
<pre>
- var MyController = function(dep1, dep2) {
- ...
- }
- MyController.$inject = ['dep1', 'dep2'];
-
- MyController.prototype.aMethod = function() {
+ var MyController = function($scope, dep1, dep2) {
...
+ $scope.aMethod = function() {
+ ...
+ }
}
+ MyController.$inject = ['$scope', 'dep1', 'dep2'];
</pre>