Skip to content

PranamBhat/HostBinding-and-HostListener

Repository files navigation

HostBinding and HostListener


  • HostBinding - Declares a host property binding. Angular automatically checks host property bindings during change detection. If a binding changes, it will update the host element of the directive.

  • @HostBinding - will bind the property to the host element, If a binding changes, HostBinding will update the host element.

  • Reference : https://angular.io/api/core/HostBinding

  • HostListener - Declares a host listener. Angular will invoke the decorated method when the host element emits the specified event.

  • @HostListener - will listen to the event emitted by the host element that's declared with @HostListener.

  • Reference : https://angular.io/api/core/HostListener


This project was generated with Angular CLI Angular: 12.0.5.




Development Server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code Scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running Unit Tests

Run ng test to execute the unit tests via Karma.

Running End-To-End Tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further Help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

From Developer

You can get in touch with me on my LinkedIn Profile: LinkedIn Link

You can also follow me on GitHub to stay updated about my latest projects: GitHub Follow

If you liked the repo then kindly support it by giving it a star ⭐

Contact

Made with ❤️ by Pranam Bhat. Connect me on https://www.linkedin.com/in/pranam-bhat-11670689/

For any queries : [email protected]