mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-26 14:43:59 +00:00
docs(minErr): add controller/noscp docs
This commit is contained in:
parent
74d50f7c16
commit
3fb80b4ea1
1 changed files with 17 additions and 0 deletions
|
|
@ -2,3 +2,20 @@
|
||||||
@name $controller:noscp
|
@name $controller:noscp
|
||||||
@fullName Missing $scope object
|
@fullName Missing $scope object
|
||||||
@description
|
@description
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Example of incorrect usage that leads to this error:
|
||||||
|
```
|
||||||
|
$controller(MyController);
|
||||||
|
//or
|
||||||
|
$controller(MyController, {scope: newScope});
|
||||||
|
```
|
||||||
|
|
||||||
|
To fix the example above please provide a scope to the $controller call:
|
||||||
|
|
||||||
|
```
|
||||||
|
$controller(MyController, {$scope, newScope});
|
||||||
|
```
|
||||||
|
|
||||||
|
Please consult the {@link api/ng.$controller $controller} service api docs to learn more.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue