CORE ANGULAR • LESSON 3 OF 23

Property, Attribute and Event Binding

What you will learn

Send values to elements and respond to user actions with explicit bindings.

  • Square brackets bind an element or component property. Parentheses listen for an event. Interpolation is convenient for text and string-valued properties.
  • Properties describe the current live element state; attributes provide initial markup or semantics. Use attr.colspan and ARIA attribute bindings when no matching DOM property exists.
  • The event object is available as $event. Prefer a named method when logic is longer than a simple assignment.
  • Input values are strings. Convert them before arithmetic, and define behavior for invalid input and division by zero.

How it works

1Component value
2Property binding updates control
3User event fires
4Handler updates signal

Expected result

Typing keeps the signal synchronized. Display is disabled for blank input and prints an uppercase name after a valid click.

Common mistakes

Do not call a method during binding when you mean to pass it as an event response. Do not read $event.target.value without narrowing the target type in strict TypeScript.

Read the official Angular guide →