I realized that since the util uses toSignal, it should be able to be given an injector optionally.
export function allEventsSignal<T>(
form: AbstractControl<T>,
injector?: Injector
): Signal<FormEventData<T>>;
export function allEventsSignal<T>(
form: AbstractControl,
injector?: Injector
): Signal<FormEventData<T>>;
export function allEventsSignal<T>(
form: AbstractControl<T>,
injector?: Injector
): Signal<FormEventData<T>> {
return toSignal(allEventsObservable(form), {
initialValue: {
value: form.value, // <-- by the way, this will be .getRawValue() in #499
status: form.status,
pristine: form.pristine,
touched: form.touched,
valid: form.valid,
invalid: form.invalid,
pending: form.pending,
dirty: form.dirty,
untouched: form.untouched,
}, injector: injector});
}
Should be easy enough but I have to make test scenarios, and I want to see if anyone else has any injection considerations I haven't accounted for. Thoughts?
I realized that since the util uses
toSignal
, it should be able to be given an injector optionally.Should be easy enough but I have to make test scenarios, and I want to see if anyone else has any injection considerations I haven't accounted for. Thoughts?