tezvyn:

Angular's input() Function: Passing Data to Components

Source: angular.devbeginner

Angular's input() function lets a parent pass data to a child, defining the child's public API. Use it to configure a component, like passing a `value` to a slider. The footgun: the returned signal is read-only; the child cannot modify its own input.

Think of Angular's `input()` function as defining a component's "props" or public data API. It's how a parent passes data to a child, making it configurable. You'd use it to pass a user object to a profile card or a starting value to a slider. The footgun: the returned `InputSignal` is read-only. A child cannot directly modify its input; it must emit an event to request a change.

Read the original → angular.dev

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Angular's input() Function: Passing Data to Components · Tezvyn