bindToController
should work without controllerAs
#15088
Description
Do you want to request a feature or report a bug?
bug
What is the current behavior?
If I create a directive with bindToController
and without controllerAs
, I get $compile:noident
: Controller identifier is required.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
http://plnkr.co/edit/lhg3NJABx2DQWnF56rzg
What is the expected behavior?
controllerAs
shouldn't be required. If the directive doesn't create a scope, adding controllerAs
to it will pollute the outer scope.
What is the motivation / use case for changing the behavior?
Use case: directives that have controller bindings, but have neither a template nor an own scope. What do they need controllerAs
for?
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
1.5.8