angular: HostBinding can't bind to host input property other than `class.`, `attr.` and `style.`
I’m submitting a … (check one with “x”)
[x ] bug report
Current behavior
When binding to a custom input property acproperty
on the host component using @HostBinding()
I get an error:
Can’t bind to ‘acproperty’ since it isn’t a known property of ‘a-comp’
Expected behavior
I expect @HostBinding()
decorator to bind to any property on the host component, not just the ones with class.
, attr.
and style.
Minimal reproduction of the problem with instructions Here is the Plunker
Windows10, Angular 4.x, Chrome
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 35 (23 by maintainers)
And also opposite as:
You may say that ^^ is not for general using because of specific typing. You are right. But there is a solution using:
where
Parent
is defined on any component as:where
Parent
is abstract class:@maximusk Just use the normal DI way in constructor as if it’s a service, an example can be found in: http://plnkr.co/edit/BxCmIX1Ghkx39WgdzJAv?p=preview