Controllers are an important part of Angular applications. The implementation of controllers is perhaps surprisingly tightly coupled with directives. Even when “standalone” controllers are used, as with ngController, it’s really just an application of the directive controller system.
Issue Checklist
[ ] How controllers can be instantiated by the $controller service.
[ ] How controller instantiation supports dependency injection.
[ ] How controllers can be pre-registered in the config phase using $controllerProvider or modules.
[ ] That controllers can be optionally looked up from window, even though doing it is not recommended nor is it enabled by default.
[ ] How controllers can be attached to directives.
[ ] That every directive gets its own controller instance, and that there can be many directives with controllers on the same DOM.
[ ] How the special @ value can be used to defer the directive controller resolution to the directive user.
[ ] How $scope, $element, and $attrs are made available for dependency injection in directive controllers.
[ ] How a directive controller can be attached to the directive’s scope using controllerAs.
[ ] How isolate scope bindings can be attached to controller objects instead of the isolate scope using bindToController.
[ ] How bindings can be attached using bindToController even without using an isolate scope.
[ ] How controllers are instantiated in a deferred fashion inside $compile to support bindToController.
[ ] How a sibling directive’s controller can be required by specifying a require attribute whose value is the sibling directive’s name.
[ ] How multiple requires can be specified using an arrays or object syntax.
[ ] That if a directive has a controller and does not require any other directives, it is as if the directive requires itself.
[ ] How parent directives can be require with ^ and ^^.
[ ] How requires can be made optional with ?.
[ ] How the ngController directive works.
[ ] How controllers can also be attached on the scope by giving a ControllerConstructor as scopeName style expression to $controller.
[ ] How $controller also tries to find controller constructors from the scope, in addition to its own register and window.
Description
Controllers are an important part of Angular applications. The implementation of controllers is perhaps surprisingly tightly coupled with directives. Even when “standalone” controllers are used, as with
ngController
, it’s really just an application of the directive controller system.Issue Checklist
$controller
service.$controllerProvider
or modules.window
, even though doing it is not recommended nor is it enabled by default.@
value can be used to defer the directive controller resolution to the directive user.$scope
,$element
, and$attrs
are made available for dependency injection in directive controllers.controllerAs
.bindToController
.bindToController
even without using an isolate scope.$compile
to supportbindToController
.require
attribute whose value is the sibling directive’s name.requires
can be specified using an arrays or object syntax.^
and^^
.?
.ngController
directive works.ControllerConstructor as scopeName
style expression to$controller
.$controller
also tries to find controller constructors from the scope, in addition to its own register andwindow
.All issues in milestone: 0.6.0 milestone
Assignees