docs: fix hostbinding. (#63509)

HostBindings only work on properties and getters. Not methods.

fixes #57909

PR Close #63509
This commit is contained in:
Matthieu Riegler
2025-08-31 15:52:44 +02:00
committed by Jessica Janiuk
parent 7dde1951d0
commit 0495254143
@@ -67,7 +67,7 @@ export class CustomSlider {
You can alternatively bind to the host element by applying the `@HostBinding` and `@HostListener`
decorator to class members.
`@HostBinding` lets you bind host properties and attributes to properties and methods:
`@HostBinding` lets you bind host properties and attributes to properties and getters:
```angular-ts
@Component({
@@ -78,7 +78,7 @@ export class CustomSlider {
value: number = 0;
@HostBinding('tabIndex')
getTabIndex() {
get tabIndex() {
return this.disabled ? -1 : 0;
}