Skip to content

Commit 3fb80b4

Browse files
committed
docs(minErr): add controller/noscp docs
1 parent 74d50f7 commit 3fb80b4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/content/error/controller/noscp.ngdoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,20 @@
22
@name $controller:noscp
33
@fullName Missing $scope object
44
@description
5+
6+
This error occurs when {@link api/ng.$controller $controller} service is called in order to instantiate a new controller but no scope is provided via `$scope` property of the locals map.
7+
8+
Example of incorrect usage that leads to this error:
9+
```
10+
$controller(MyController);
11+
//or
12+
$controller(MyController, {scope: newScope});
13+
```
14+
15+
To fix the example above please provide a scope to the $controller call:
16+
17+
```
18+
$controller(MyController, {$scope, newScope});
19+
```
20+
21+
Please consult the {@link api/ng.$controller $controller} service api docs to learn more.

0 commit comments

Comments
 (0)