8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a8e113 commit a9e02deCopy full SHA for a9e02de
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