Which @angular/* package(s) are relevant/related to the feature request?
core
Description
If I want to pass signal based data to a ComponentRef we have to set the input and create an effect to update the input.
const counterSignal = signal<number>(0) // signal from store or some service
const counterOverlayRef = createOverlay(); // using CDK Overlay
const counterComponentRef = counterOverlayRef.attach(new ComponentPortal(MyCounterComponent));
counterComponentRef.setInput('count', counterSignal());
effect(() => {
counterComponentRef.setInput('count', counterSignal());
}, { injector: counterComponentRef.injector }); // using component ref injector to cleanup effect with component
Proposed solution
It would be nice to streamline this by passing the signal itself.
const counterSignal = signal<number>(0) // signal from store or some service
const counterOverlayRef = createOverlay(); // using CDK Overlay
const counterComponentRef = counterOverlayRef.attach(new ComponentPortal(MyCounterComponent));
counterComponentRef.setInput('count', counterSignal);
Alternatives considered
I see there may be a problem with the auto-detection of signals in the setInput method, when the input requires a signal. That's why I would suggest a config flag or separate method.
counterComponentRef.setInput(counterSignal, { useSignal: true })
counterComponentRef.setInputBySignal(counterSignal)
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
If I want to pass signal based data to a
ComponentRefwe have to set the input and create an effect to update the input.Proposed solution
It would be nice to streamline this by passing the signal itself.
Alternatives considered
I see there may be a problem with the auto-detection of signals in the
setInputmethod, when the input requires a signal. That's why I would suggest a config flag or separate method.