You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -294,6 +294,46 @@ To complete the flow, it would also be possible to modify the book data and send
294
294
> We presented the Resource API in a separate blog post (in German 🇩🇪): **[Die neue Resource API von Angular](https://angular-buch.com/blog/2024-10-resource-api)**
295
295
296
296
297
+
### Connecting Reactive Forms with Signals
298
+
299
+
We can even use Linked Signals for building helpers that connect other worlds to signals.
300
+
For example, this wrapper function synchronises a `FormControl` (or any other control) from Angular's Reactive Forms with a signal.
301
+
Data is synchronized bidirectionally: When the form value changes (`valueChanges`), the signal value will be updated.
302
+
The signal returned from the function is writable, so whenever we change the value in the signal, the form value will be updated (`setValue()`).
In this example, you see an effect that establishes a **reactive listener**, which automatically responds to changes in signals. The function inside `effect()` makes sure that whenever the signal `controlSignal` changes, the form control value is updated via `setValue()`. This creates a **two-way synchronization** between the signal and the form control.
315
+
For a more detailed exploration of `effect()` and its capabilities, read our article: **[Angular 19: Mastering effect and afterRenderEffect](/blog/2024-11-effect-afterrendereffect)**.
0 commit comments