event binding in angular 6

Опубликовано: 30 Октябрь 2024
на канале: Programming with Karthik
614
6

event binding in angular 6
Angular 9 Tutorial | EP6 | event binding in angular 6 (KINDLY SUBSCRIBE)
Checkout My Channel:    / @programmingwithkarthik1472  
Complete Playlist:    • Angular 9 Tutorial  

For reading Angular
Please refer to this playlist
   • Angular 9 Tutorial  

Kindly Subscribe

Binding - Just a communication between Component and View.
1) Property Binding
2) Event Binding


Property Binding -

a) Interpolation: {{}}

Evaluates a expression and converts to string

Angular interpolation is used display a component property in the respective view template with double curly braces syntax. We can display all kind of properties data into view e.g. string, number, date, arrays, list or map.


Another major difference is that to set an element property to a non-string data value, we must use property binding.

b) Property Binding:[]

properties in the DOM element can be bound

Event Binding:
We can bind most of the common events in the DOM:

(focus)="focusCallback()"
(blur)="blurCallback()"
(submit)="submitCallback()"
(scroll)="scrollCallback()"
(cut)="cutCallback()"
(copy)="copyCallback()"
(paste)="pasteCallback()"
(keydown)="keydownCallback()"
(keypress)="keypressCallback()"
(keyup)="keyupCallback()"
(mouseenter)="mouseenterCallback()"
(mousedown)="mousedownCallback()"
(mouseup)="mouseupCallback()"
(click)="clickCallback()"
(dblclick)="dblclickCallback()"
(drag)="dragCallback()"
(dragover)="dragoverCallback()"
(drop)="dropCallback()"