Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
When using withEventReplay(), the (load) event listener is called twice: once by invokeRegisteredReplayListeners -> invokeListeners, and again by the listener instruction, which also sets up the load event listener.

Please provide a link to a minimal reproduction of the bug
https://github.com/arturovt/ng-issue-event-replay-twice
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 19.0.4
Node: 20.11.1
Package Manager: yarn 1.22.22
OS: linux x64
Angular: 19.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1900.4
@angular-devkit/build-angular 19.0.4
@angular-devkit/core 19.0.4
@angular-devkit/schematics 19.0.4
@schematics/angular 19.0.4
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
Anything else?
No response
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
When using
withEventReplay(), the(load)event listener is called twice: once byinvokeRegisteredReplayListeners -> invokeListeners, and again by thelistenerinstruction, which also sets up theloadevent listener.Please provide a link to a minimal reproduction of the bug
https://github.com/arturovt/ng-issue-event-replay-twice
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version)Anything else?
No response