We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee988d4 commit b40130aCopy full SHA for b40130a
docs/content/error/$injector/unpr.ngdoc
@@ -54,4 +54,18 @@ angular.module('myModule')
54
.directive('myDirective', ['myCoolService', function (myCoolService) {
55
// This directive definition does not throw unknown provider.
56
}]);
57
-```
+```
58
+
59
60
+Attempting to inject one controller into another will also throw an `Unknown provider` error:
61
62
63
+angular.module('myModule', [])
64
+ .controller('MyFirstController', function() { /* ... */ });
65
+ .controller('MySecondController', ['MyFirstController', function(MyFirstController) {
66
+ // This controller throws an unknown provider error because
67
+ // MyFirstController cannot be injected.
68
+ }]);
69
70
71
+Use the `$controller` service if you want to instantiate controllers yourself.
0 commit comments