Sitemap
Ruchi Sharma

Ruchi Sharma

Angular Signals

Apr 22, 2025

So, before understanding signals, we need to know about Reactivity.

Get Ruchi Sharma’s stories in your inbox

Join Medium for free to get updates from this writer.

Reactivity means automatically reacting or updating when something (Signal value) changes.

//import Signal first
import {signal} from '@angular/core';
// Create a signal with the `signal` function.
const EmpName = signal('Ruchi');
// To read a signal's value we have do it like below— signals are functions.
console.log(EmpName());
// we can change the value of signal by `set` method with a new value.
EmpName.set('Aayushi');
// You can also use the `update` method to change the value
// based on the previous value.
EmpName.update(nameval => nameval.toUpperCase());

--

--