Skip to content

[18.1] AfterNextRender only invokes first phase callback when provided multiple via new API #56979

@atsjo

Description

@atsjo

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

The new AfterRender/AfterNextRender API in v18.1 allows providing callbacks for different phases in a single call. This works fine for AfterRender, but doesn't for AfterNextRender.

Repro by creating minimal app via 18.1 cli and add:

    afterRender({ earlyRead: () => console.log('each render earlyRead'), write: () => console.log('each render write') });
    afterNextRender({ earlyRead: () => console.log('next render earlyRead'), write: () => console.log('next render write') });

in component constructor, and view logging in devtools... ('next render write' is missing)

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 18.1.0
Node: 22.4.1
Package Manager: pnpm 9.5.0
OS: win32 x64

Angular: 18.1.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, material
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1801.0 (cli-only)
@angular-devkit/build-angular   18.1.0
@angular-devkit/core            18.1.0
@angular-devkit/schematics      18.1.0
@angular/fire                   18.0.1
@schematics/angular             18.1.0
ng-packagr                      18.1.0
rxjs                            7.8.1
typescript                      5.5.3
zone.js                         0.14.7

Anything else?

also using nx

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions