Skip to main content

What is a signal in Angular?

signal in Angular is a new reactive primitive (starting with Angular 16) that stores a value and lets Angular automatically track who reads that value and who needs to be updated when it changes. It is an alternative to streams (RxJS) in simple scenarios and a replacement for @Input(), @Output(), BehaviorSubject, and part of the zone-based machinery.

What it looks like

ts
import { signal } from '@angular/core'; const counter = signal(0); console.log(counter()); // read the value counter.set(1); // set a new value counter.update(v => v + 1); // change based on the previous one

How it works underneath

  • signal() creates a value store
  • reading is calling counter()
  • writing is set() or update()
  • Angular tracks which expressions read the signal, and on change updates only the related templates, effects, or computed signals
  • computed(), a computed value based on other signals
  • effect(), a reaction to signal changes (e.g. logging or calling a method)

Where it is typically used

  • component state without RxJS
  • storing UI state (filters, flags, counters)
  • simple reactivity in a template without subscriptions and the async pipe

Main difference from RxJS

SignalsRxJS
Pull modelPush model
State is a single valueStreams of events
Minimal subscriptionsSubscriptions are required
Simple for local stateComplex asynchronous scenarios, event handling

Summary: signal is a new reactive state mechanism in Angular that simplifies reactivity inside components and makes it declarative. RxJS remains in place for complex streams and asynchronous logic.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.