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 }}
Repository navigation
Child directive does not inherit parent directive's click handler #18331
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Child directive does not inherit parent directive's click handler.
Expected behavior
Child directive should inherit parent directive's click handler.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Angular version: X.Y.Z
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Activity
trotyl commentedon Jan 11, 2018
This is the expected behavior according to the semantics described here:
The entire
@Directivemetadata on base class will be overwritten by@Directivedefined in derived class.When changing to
@HostListener('click')it will work as expected since it's a property decorator and didn't get overwritten."Fixing" this would be a breaking change for existing inheritance behavior.
pkozlowski-opensource commentedon Feb 18, 2020
This works as expected in Angular v9 with ivy enabled: https://ng-run.com/edit/8KIr8DNkj82a7Fbj3Eyv
angular-automatic-lock-bot commentedon Mar 20, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.