mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
As described in https://github.com/angular/angular/discussions/49681#discussioncomment-5628930, if an `Observable` created from a signal with `toObservable` is subscribed to in a template, it will initially have `null` as the value. Immediately after the template is done executing, effects are flushed and this results in the `AsyncPipe` getting a new value before the `checkNoChanges` pass, resulting in `ExpressionChanged` error. ``` template: '{{obs$ | async}}' ... obs$ = toObservable(signal(0)); ``` Instead, this commit updates the `toObservable` to synchronously emit the initial value to the Observable stream. Side note here: We don't exactly encourage this pattern. Instead of using `AsyncPipe`, the template should just read signals. PR Close #49894 |
||
|---|---|---|
| .. | ||
| global | ||
| rxjs-interop | ||
| schematics | ||
| src | ||
| test | ||
| testing | ||
| BUILD.bazel | ||
| index.ts | ||
| package.json | ||
| PACKAGE.md | ||
| public_api.ts | ||