In a directive, the ________ decorator is used to get a reference to the host element.
- @Directive
- @HostBinding
- @HostListener
- @Injectable
In a directive, the @HostBinding decorator is used to get a reference to the host element, allowing you to access and modify its properties.
Loading...
Related Quiz
- Which command is used to install Angular Universal in an existing Angular project?
- How can you dynamically add or remove form controls in an Angular form?
- In your Angular application, a certain feature is only available to users who are logged in. You want to write an E2E test to ensure this feature is hidden from guests and visible to authenticated users. How can you simulate different user states in your Protractor tests?
- You need to build a form that fetches and populates its options (e.g., a dropdown list) from an API. Which form approach would allow you more flexibility and control over handling data asynchronously?
- How can you apply a custom validator to a form control in Angular?