mechanisms Flashcards
An expression
A single line of code that evaluates to a value. The value may be an arithmetic operation, a logical comparison or a call to a method over an object
Whe we use interpolation throught the expression:”{{name}}”
Angular searches for the required values for the evaluation, perform the evaluation and then replaces the expression with the result in the rendering process
Property binding
Angular capability to keep the same value in a field of the memory and an element inner the DOM; to chage both values when one of the two changes.
Property binding from class field to an DOM element property:
img [tag_property_name]=”ts_class_field”
Event binding (rending) from a class method to an event in the DOM:
input (event_name)=”callTheMethodOrFunction($event)” // in the DOM
callTheMethodOrFunction(e:SomeEvent){ // event implementation } //inside our component
Type Assertion Example
this.imgURL = ( e.target as HTMLInputElement).value