Suggest an editImprove this articleRefine the answer for “How to convert an observable to a signal?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To convert an `Observable` into a `signal`, you use the `toSignal()` function from `@angular/core/rxjs-interop`. **Key point:** `toSignal()` turns an RxJS stream into an ordinary signal that can be used in a template without an `async` pipe.Shown above the full answer for quick recall.Answer (EN)ImageTo convert an `Observable` into a `signal`, you use the `toSignal()` function from `@angular/core/rxjs-interop`. ### Example: ```ts import { Component } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { interval } from 'rxjs'; @Component({ selector: 'app-timer', template: ` <p>Counter: {{ time() }}</p> ` }) export class TimerComponent { // Observable, emits a new number every second source$ = interval(1000); // Convert Observable → Signal time = toSignal(this.source$, { initialValue: 0 }); } ``` ### What `toSignal()` does: - creates a signal that automatically updates on every new value from the Observable; - `initialValue` is a required parameter, for while the stream has not yet emitted its first value; - Angular manages the subscription and unsubscription itself, nothing needs to be done manually. **Summary:** `toSignal()` turns an RxJS stream into an ordinary signal that can be used in a template without an `async` pipe.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.