We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 757a70e commit 78761f1Copy full SHA for 78761f1
docs/content/error/$injector/unpr.ngdoc
@@ -69,3 +69,15 @@ angular.module('myModule', [])
69
```
70
71
Use the `$controller` service if you want to instantiate controllers yourself.
72
+
73
+Attempting to inject a scope object into anything that's not a controller or a directive,
74
+for example a service, will also throw an `Unknown provider: $scopeProvider <- $scope` error.
75
+This might happen if one mistakenly registers a controller as a service, ex.:
76
77
+```
78
+angular.module('myModule', [])
79
+ .service('MyController', ['$scope', function($scope) {
80
+ // This controller throws an unknown provider error because
81
+ // a scope object cannot be injected into a service.
82
+ }]);
83
0 commit comments