Angular Signal Inputs: Declaration, Transform, and Common Pitfalls
Angular input() declares read-only signal-based component inputs. Use transform, alias, and required options; call signals with parentheses in templates and code.
25 Aug 2026, 19:29 UTC

Signal inputs replace @Input() for new components
Angular's input() function from @angular/core declares a signal-based component input. Unlike the decorator-based @Input(), the result is a read-only signal that you call to read the current value—this.label() instead of this.label. Parent templates still use property binding: [label]="title". The signal updates automatically during change detection, and derived state via computed() or reactions via effect() work without manual subscription management.
Use input() for every new component. Reserve @Input() only when maintaining legacy code that cannot migrate yet. Mixing both mechanisms for the same logical input is not supported and causes confusing bugs.
Worked example: a typed input with transform and alias
import { Component, input, computed } from '@angular/core';
@Component({
selector: 'app-status-badge',
standalone: true,
template: `<span class="badge badge-{{ kind() }}">{{ label() }}</span>`
})
export class StatusBadgeComponent {
// Required string input, bound in parent as [statusKind]
kind = input.required<string>({ alias: 'statusKind' });
// Optional numeric input with synchronous transform
// Parent may pass a string; transform coerces to number
count = input<number, unknown>(0, {
transform: (value: unknown) => Number(value),
alias: 'itemCount'
});
// Derived signal: updates when kind or count changes
severity = computed(() => {
const k = this.kind();
const c = this.count();
if (k === 'error' && c > 5) return 'critical';
if (k === 'warn') return 'elevated';
return 'normal';
});
}
Parent usage:
<app-status-badge [statusKind]="currentStatus" [itemCount]="totalErrors"></app-status-badge>
The transform option runs synchronously during change detection whenever the bound value changes. It receives the raw bound value (here unknown) and must return the coerced type (number). It cannot be async, make HTTP calls, or produce side effects—doing so breaks change detection timing and causes unpredictable behavior.
Reading values inside the component
Call the signal to read: this.kind(), this.count(). Accessing the signal without parentheses (this.kind) gives you the signal function itself, not the value. In templates, always include parentheses: {{ label() }}. Omitting them renders the function object, a common source of "[object Function]" appearing in the UI.
Because the input is a signal, it integrates directly with computed() and effect(). The severity computed above re-evaluates automatically when kind or count changes. No ngOnChanges, no Subject, no manual unsubscription.
Required inputs and default values
input.required<T>() marks the input as mandatory. Angular throws a clear error during development if the parent omits the binding. For optional inputs, provide a default: input<string>('fallback'). The default is used only when the parent does not bind the input at all; an explicit null or undefined binding passes that value through (subject to transform).
Alias: template name differs from property name
The alias option lets the component property name differ from the template binding name. In the example, the component uses kind and count, while parents bind [statusKind] and [itemCount]. This is useful when migrating from @Input('statusKind') or when the public API name should not match the internal name.
Limits and common mistakes
Inputs are read-only
You cannot assign to an input() signal: this.kind.set('error') or this.kind = input.required() inside the component class will fail at runtime. The signal is owned by the framework and updated only via parent bindings. If you need local mutable state derived from an input, create a separate signal with signal() and update it in an effect() that watches the input.
Transform must be pure and synchronous
Transform runs during change detection. Side effects (logging, HTTP, timers) or async operations break the change detection contract and can cause infinite loops or stale UI. Keep transform functions pure: type coercion, validation, default substitution, simple mapping.
Template binding requires parentheses
{{ title() }} works; {{ title }} prints the signal function. Enable strict templates in tsconfig.json ("strictTemplates": true) and run ng build to catch missing parentheses at compile time.
Do not mix @Input() and input() for the same input
Declaring @Input() label and label = input() in the same component creates two separate bindings with undefined precedence. Pick one mechanism per component. For incremental migration, convert the entire component at once.
Type narrowing with transform
The transform generic signature is input<OutputType, InputType>(). In the example, input<number, unknown>() tells TypeScript the parent may pass unknown but the component receives number. If you omit the second generic, it defaults to the first, so input<number>() expects the parent to bind a number directly.
Verification checklist
- Add
readonly count = input<number>(0)to a child component, bind[count]="parentValue"in the parent template, and confirm the child displays{{ count() }}. - Provide
transform: (v: unknown) => Number(v)and pass a string from the parent; verify the child receives a number (e.g.,typeof this.count() === 'number'). - Run
ng buildwithstrictTemplates: trueto catch missing signal call parentheses and type mismatches in bindings. - Test a required input by omitting the binding in a test parent; confirm Angular throws the expected development-mode error.
When to stick with @Input()
Only when the component must remain compatible with Angular versions before 17.1 (where input() was introduced) or when the codebase has a hard constraint preventing signal adoption. Otherwise, input() is the supported, future-proof API with better type safety, reactivity integration, and developer ergonomics.