Angular's toObservable
function enables converting signals to RxJS observables. This allows creating observable properties that stay synchronized with signal values.
Whenever the signal value changes, the corresponding observable emits a notification, facilitating the interoperability between signals and observables.
[00:00] Create a new property. We will use the same name as the signal that already exists. We'll just use the convention of the ending dollar for RX JS observables. Use the to observable function, which we're going to import from Angular slash core slash RX JS interop package. So [00:20] we are going to mirror the value of the name filter signal, which we can see up and running over here. So to observable accepts an existing angular signal. So we'll put that this dot two filter and that's it. So whenever there is a value inside the signal that [00:39] changes, to observable is going to emit a next notification. So we just need only a way to prove that this works. So a subscription and for this reason, we'll create simply a constructor which is going to include a this dot name filter observable dot [00:59] subscribe with a console log just to see that the whole thing works. So when we write down, the signal fuels the filtering on the view and the console log is being fueled by the observable subscription.