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

Publié le: 01 décembre 2019
sur la chaîne: 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


Sur cette page du site, vous pouvez voir la vidéo en ligne Event Binding in Angular || Angular Event binding [Imp Angular Interview Concept] durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Code Decode 01 décembre 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,504 fois et il a aimé 29 téléspectateurs. Bon visionnage!