Angular Signals
Signals API, computed, effect, signal inputs, signal queries, reactivity model, migration from RxJS
1What is a signal in Angular?
What is a signal in Angular?
Answer
A signal is a reactivity primitive introduced in Angular 16+ that wraps a value and automatically notifies consumers when that value changes. Unlike RxJS Observables, signals offer a simpler and more performant approach to managing reactive state. They are synchronous by default and integrate natively with Angular's change detection system.
2How to create a signal with an initial value?
How to create a signal with an initial value?
Answer
Use the signal() function with the initial value as parameter: signal(0) creates a signal containing 0. The returned signal is a getter function that can be called to read the value. To modify the value, use set(), update() or mutate() methods. The syntax is concise and avoids the verbosity of RxJS BehaviorSubject.
3How to read the value of a signal?
How to read the value of a signal?
Answer
Call the signal as a function: count() returns the current value. This syntax allows Angular to automatically track dependencies in reactive contexts (templates, computed, effect). Unlike Observables that require subscribe() or async pipe, signals offer synchronous and direct reading.
Which method to use to completely replace a signal's value?
How to update a signal based on its previous value?
+17 interview questions
Other Angular interview topics
TypeScript Basics
TypeScript Advanced
Angular Fundamentals
Components & Lifecycle
Services & Dependency Injection
Angular Modules Organization
Angular CLI
Directives & Pipes
Routing & Navigation
Reactive Forms
Template-driven Forms
RxJS Fundamentals
RxJS Operators
HttpClient & API Calls
Basic State Management
Change Detection
Standalone Components
Angular Unit Testing
End-to-End Testing
Build & Optimization
NgRx Fundamentals
NgRx Advanced
Angular Architecture
Performance Optimization
Security & Best Practices
Advanced RxJS Patterns
Angular Universal & SSR
Angular Micro-frontends
Master Angular for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free