Open cexbrayat opened 19 hours ago
core
Yes
A template with the following HTML:
<button (click)="someSubject.next()">Click</button>
is migrated to:
<button (click)="someSubject.emit()">Click</button>
even if someSubject is a Subject and not an EventEmitter
someSubject
Subject
EventEmitter
The same issue exists in host listeners.
To repro, in the following Stackblitz, run:
ng g @angular/core:signals --migrations=outputs --path=./ --no-best-effort-mode
https://stackblitz.com/edit/stackblitz-starters-ffuzvu?file=src%2Fmain.ts
ng version
Angular CLI: 19.0.0-rc.1 Node: 20.13.1 Package Manager: npm 9.7.1 OS: darwin arm64 Angular: 19.0.0-rc.1 ... animations, cli, common, compiler, compiler-cli, core, forms ... platform-browser, platform-browser-dynamic, router Package Version --------------------------------------------------------- @angular-devkit/architect 0.1900.0-rc.1 @angular-devkit/build-angular 19.0.0-rc.1 @angular-devkit/core 19.0.0-rc.1 @angular-devkit/schematics 19.0.0-rc.1 @schematics/angular 19.0.0-rc.1 rxjs 7.8.1 typescript 5.6.3 zone.js 0.15.0
No response
@pkozlowski-opensource I opened a PR with a potential fix in #58631
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
A template with the following HTML:
is migrated to:
even if
someSubject
is aSubject
and not anEventEmitter
The same issue exists in host listeners.
To repro, in the following Stackblitz, run:
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-ffuzvu?file=src%2Fmain.ts
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response