You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
I recently ran into an issue when using inherited scopes with controllerAs and bindToController. The situation is as follows:
The parent and child directives use the same controller alias (controllerAs: 'controller')
The child directive binds an action from the parent using an event binding. (bindToController: { action: '&' })
The child directive uses an inherited scope. (scope: true) This is important because the binding appears to work correctly with an isolate scope.
The parent directive binds a method from its controller to the child action. (action="controller.parentAction()")
When the child triggers a call to the action, the angular compiler incorrectly picks up the controller of the child directive instead of the parent, thus leading to a noop or an incorrect function call.
I don't know exactly where the issue originates, but I do know the following line is hit with the child scope when the child tries to trigger the action:
I recently ran into an issue when using inherited scopes with controllerAs and bindToController. The situation is as follows:
The parent and child directives use the same controller alias (controllerAs: 'controller')
The child directive binds an action from the parent using an event binding. (bindToController: { action: '&' })
The child directive uses an inherited scope. (scope: true) This is important because the binding appears to work correctly with an isolate scope.
The parent directive binds a method from its controller to the child action. (action="controller.parentAction()")
When the child triggers a call to the action, the angular compiler incorrectly picks up the controller of the child directive instead of the parent, thus leading to a noop or an incorrect function call.
Plunkr: http://plnkr.co/edit/JRCoRIsDV3UpS6D2ELKa?p=preview
Angular Version: 1.4.5
I don't know exactly where the issue originates, but I do know the following line is hit with the child scope when the child tries to trigger the action:
angular.js/src/ng/compile.js
Line 2765 in 96288d0
The text was updated successfully, but these errors were encountered: