forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($controller): throw when requested controller is not registered
Previously, it would throw the ng:areq error, which is less specific and just informs that the requested controller is not defined. Given how commonly controllers are used in Angular, it makes sense to have a specific error. The ng:areq error is still thrown when the registered controller is not a function. Closes angular#14980 PR (angular#15015)
- Loading branch information
1 parent
6cedd11
commit 18be806
Showing
5 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@ngdoc error | ||
@name $controller:ctrlreg | ||
@fullName A controller with this name is not registered. | ||
@description | ||
|
||
This error occurs when the {@link ng.$controller `$controller()`} service is called | ||
with a string that does not match any of the registered controllers. The controller service may have | ||
been invoked directly, or indirectly, for example through the {@link ng.ngController `ngController`} directive, | ||
or inside a {@link angular.Module#component component} / {@link angular.Module#directive directive} / | ||
{@link ngRoute.$routeProvider#when route} definition (when using a string for the controller property). | ||
Third-party modules can also instantiate controllers with the {@link ng.$controller `$controller()`} service. | ||
|
||
Causes for this error can be: | ||
|
||
1. Your reference to the controller has a typo. For example, in | ||
the {@link ng.ngController `ngController`} directive attribute, in a {@link angular.Module#component component} | ||
definition's controller property, or in the call to {@link ng.$controller `$controller()`}. | ||
2. You have not registered the controller (neither via {@link angular.Module#controller `Module.controller`} | ||
nor {@link ng.$controllerProvider#register `$controllerProvider.register()`}. | ||
3. You have a typo in the *registered* controller name. | ||
|
||
|
||
Please consult the {@link ng.$controller $controller} service api docs to learn more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters