DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

Angular Component Input Properties: `input()`, `@Input`, and Two-Way Binding

Angular component inputs pass values from parent to child. Compare input(), required signal inputs, @Input, transforms, aliases, and model() for two-way binding.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Angular component inputs let a parent pass values to a child component through template bindings. For new Angular projects, the recommended API is the signal-based input(); @Input remains supported for existing or decorator-style code. Use input.required() when a value must be supplied, and use model() when a child must also send changes back to its parent.

How Angular component inputs work

An input is a property that a component or directive exposes for a parent to bind. For example, a parent can pass a value with <custom-slider [value]="50" />. The binding name is the input’s public template name; the child reads the value through its declared input property.

As an Amazon Associate I earn from qualifying purchases.

Angular recognizes signal inputs when input() or input.required() initializes a component or directive class member. Input declarations are recorded statically at compile time, so they cannot be added or removed at runtime. Input names are case-sensitive, and inputs are inherited when a component class extends another component class.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the right input API

Need API What it does
Declare a new input input() Creates a read-only signal; call it to read the current value.
Require a value from every template consumer input.required<T>() Creates a required input signal; Angular reports a missing binding at build time.
Keep or use decorator-based declarations @Input() Remains fully supported and uses the same template binding syntax.
Normalize or convert a value supplied by the parent Input transform Maps the bound value to the value the component reads.
Let the child update a value and notify the parent model() Supports two-way binding and creates a matching change output; transforms are not supported.

Angular recommends signal-based inputs for new projects, while the decorator API remains fully supported. These APIs describe different ways to declare inputs, not documented performance tiers. If maintaining code for a particular older Angular release, consult documentation for that version: for example, Angular v18 described signal inputs as developer preview, unlike the current guide’s recommendation.

Declare and read signal inputs

Use input() in a class member initializer. It returns a read-only signal, so read its current value by calling it in the class or template:

import { Component, input } from '@angular/core';

@Component({
  selector: 'custom-slider',
  template: '<p>Value: {{ value() }}</p>',
})
export class CustomSlider {
  value = input(0);
}

A parent can provide a value using the same property binding syntax:

<custom-slider [value]="volume" />

If an input has no initial value, its value can be undefined. Include a suitable initial value when that reflects the component’s behavior, or use a required input when omission is invalid.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make an input required

Declare a required signal input with input.required<T>(). The resulting signal has type T, and Angular reports a build-time error if a template uses the component without supplying that input.

import { Component, input } from '@angular/core';

@Component({
  selector: 'user-card',
  template: '<h2>{{ name() }}</h2>',
})
export class UserCard {
  name = input.required<string>();
}

Its consumer must bind the required property, for example <user-card [name]="userName" />. A required declaration catches omissions in template usage; it does not mean the parent must provide a particular literal value.

Use `@Input` in decorator-based code

The decorator API is still supported and accepts the same kind of parent template binding. It is appropriate when working in an existing decorator-style component or when that style fits the codebase. The current Angular guide recommends input() for new projects.

import { Component, Input } from '@angular/core';

@Component({
  selector: 'custom-slider',
  template: '<p>Value: {{ value }}</p>',
})
export class CustomSlider {
  @Input() value = 0;
}

The parent still writes <custom-slider [value]="volume" />. Unlike a signal input, the decorator property is read as a property rather than called as a signal.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Change the public binding name with an alias

An alias gives an input a template-facing name that differs from its class property name. This lets the component keep a useful internal name while exposing the name its consumers bind. Signal input declarations support aliases, and the @Input API also documents an alias option. Angular’s component metadata inputs option can expose inherited properties and aliases as well.

Choose names carefully: Angular warns against input names that collide with DOM element properties, because a binding can become ambiguous between the component and the element. The guide also advises against adding selector-style prefixes to component inputs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Convert incoming values with an input transform

An input transform maps the value supplied through a template binding to the value the component reads. It is useful when the public representation needs normalization or conversion, such as turning a string representation into a number. Both signal inputs and the documented @Input options support transforms.

Angular recommends input transforms over getters and setters when possible. Avoid complex or costly setters: they may be invoked multiple times. Model inputs are different; they do not support transforms.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use `model()` for two-way binding

Choose a model input when the child needs to change a value and propagate that change to the parent. A model input creates a corresponding <name>Change output, enabling two-way binding with [(name)] syntax. Model inputs can be required or aliased, but do not support transforms.

import { Component, model } from '@angular/core';

@Component({
  selector: 'custom-slider',
  template: '<button (click)="value.set(value() + 1)">Increase</button>',
})
export class CustomSlider {
  value = model(0);
}

A parent can bind a variable in both directions with <custom-slider [(value)]="volume" />. Use a regular input when data only flows from parent to child; use a model input when the child must also propagate updates.

Official Angular references

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.