O'Reilly logo

Learning Angular for .NET Developers by Rajesh Gunasundaram

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Event binding

HTML elements have various DOM events that will be fired when an event is triggered. For example, a button will fire a click event when it is clicked on. We hook an event listener to get notified whenever an event is fired:

<button (click)="doSomething()">Do Something</button>

The preceding Angular code snippet that wraps the event name in brackets needs to hook the event listener so that it gets called when a click event is fired.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required