Skip to content

docs: fix afterRenderEffect phase example in the effect guide - #71091

Merged
atscott merged 1 commit into
angular:mainfrom
GabeSilvaDev:docs/after-render-effect-phases
Sep 30, 2026
Merged

atscott merged 1 commit into
angular:mainfrom
GabeSilvaDev:docs/after-render-effect-phases

Conversation

@GabeSilvaDev

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

The "Render phases" section says that a phase is specified by passing an object with a phase property to afterRender or afterNextRender, but the example below uses afterRenderEffect with one callback for each phase.

Neither the afterRender name nor the phase option matches the current API. afterRender was renamed to afterEveryRender in #60999, and the phase option was replaced by the per-phase callback object in #55648.

The chart example above also calls this.canvas().nativeElement() even though nativeElement is a property of ElementRef, not a method.

What is the new behavior?

The description now matches the current afterRenderEffect API by explaining that phases are specified with an object containing a callback for each phase.

The chart example also uses this.canvas().nativeElement.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Docs-only change in adev/src/content/guide/signals/effect.md.

The render phases section said phases are specified by passing an object
with a `phase` property to `afterRender` or `afterNextRender`. `afterRender`
was renamed to `afterEveryRender` and the `phase` option no longer exists;
the example shows the spec object accepted by `afterRenderEffect`.

Also fix `nativeElement` being called as a function in the chart example.
@pullapprove
pullapprove Bot requested a review from crisbeto September 30, 2026 15:01
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Sep 30, 2026
@ngbot ngbot Bot added this to the Backlog milestone Sep 30, 2026
@JeanMeche
JeanMeche removed the request for review from crisbeto September 30, 2026 15:25
@JeanMeche JeanMeche added the action: merge The PR is ready for merge by the caretaker label Sep 30, 2026
@atscott atscott added the target: patch This PR is targeted for the next patch release label Sep 30, 2026
@atscott
atscott merged commit 4fa5ce0 into angular:main Sep 30, 2026
16 of 18 checks passed
@atscott

atscott commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: docs Related to the documentation target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants