Suggest an editImprove this articleRefine the answer for “What does @HostBinding() do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)The `@HostBinding()` decorator in Angular lets you **bind properties of the host element** (the DOM element that a directive or component is applied to) to class fields. **Key point:** `@HostBinding()` lets you dynamically control the properties, styles or classes of the host element from the directive or component's code.Shown above the full answer for quick recall.Answer (EN)ImageThe `@HostBinding()` decorator in Angular lets you **bind properties of the host element** (the DOM element that a directive or component is applied to) to class fields. How it works: 1. Specifies which element property will be bound to the value of a class field (for example, `class`, `style`, `attr`). 2. The value updates automatically when the class property changes. Example: ```typescript import { Directive, HostBinding } from '@angular/core'; @Directive({ selector: '[appHighlight]' }) export class HighlightDirective { @HostBinding('style.backgroundColor') background = 'yellow'; } ``` ```html <p appHighlight>Text with a yellow background</p> ``` > Conclusion: `@HostBinding()` lets you **dynamically control the properties, styles or classes of the host element** from the directive or component's code.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.