Event Binding in Angular || Angular Event binding [Imp Angular Interview Concept]

Published: 01 December 2019
on channel: Code Decode
3,504
29

Event Binding in Angular || Angular Event binding | Angular | Angular Tutorial for Beginners | Angular |

Angular Event Binding
we have discussed so far how data flows in one direction i.e from a component class property to an HTML element property.
How about data flow from template to component on user actions.
How to capture user events, user actions, button clicks, link clicks, user inputs in input html elements. how to sen data from UI to database or backend.

We can use angular event binding to get notified when these events occur.
For example the following is the syntax for binding to the click event of a button. Within parentheses on the left of the equal sign we have the target event, (click) in this case and on the right we have the template statement. In this case the onClick() method of the component class is called when the click event occurs.
[button (click)="onClick()"]Click me[/button]

Event Binding:

The interpolation and property binding are one way binding from component to view.
Event binding is used to perform an action in the component (may be executing a method) when user-raise a event – like click on button
Event binding uses the parenthesis. And name of the event is enclosed in parenthesis and then it assigned to the statement which mostly the method in the component class


On this page of the site you can watch the video online Event Binding in Angular || Angular Event binding [Imp Angular Interview Concept] with a duration of hours minute second in good quality, which was uploaded by the user Code Decode 01 December 2019, share the link with friends and acquaintances, this video has already been watched 3,504 times on youtube and it was liked by 29 viewers. Enjoy your viewing!