Turns @Component methods that call business services directly into
event-emitting methods: adds an output() signal named <method>Click and
replaces the service call with .emit(...).
Service dependencies are found in both injection styles
(constructor(private svc: MyService) and svc = inject(MyService)) by
type-name suffix (Service, Store, Repository, Facade, ...);
infrastructure types such as ChangeDetectorRef or ElementRef and
lifecycle hooks are ignored. Existing outputs are recognized in both styles
(@Output() x = new EventEmitter<T>() and x = output<T>()), and methods
that already have a matching output are skipped.
On failure the original source text is restored; on success it is returned
in metadata.originalText together with outputsAdded and
methodsTransformed.
Turns
@Componentmethods that call business services directly into event-emitting methods: adds anoutput()signal named<method>Clickand replaces the service call with.emit(...).Service dependencies are found in both injection styles (
constructor(private svc: MyService)andsvc = inject(MyService)) by type-name suffix (Service,Store,Repository,Facade, ...); infrastructure types such asChangeDetectorReforElementRefand lifecycle hooks are ignored. Existing outputs are recognized in both styles (@Output() x = new EventEmitter<T>()andx = output<T>()), and methods that already have a matching output are skipped.On failure the original source text is restored; on success it is returned in
metadata.originalTexttogether withoutputsAddedandmethodsTransformed.