docs: example code afterNextRender phase (#53025)

Currently in the angular.dev documentation, afterNextRender function
take directly the phase as a second parameter which is not correct.
According to the api of this hook, the second parameter is an object
which contains the phase. This PR update the part of the documentation

PR Close #53025
This commit is contained in:
Nicolas Frizzarin
2023-11-18 17:58:46 +01:00
committed by Andrew Kushnir
parent ed0fbd4071
commit f84057d366
@@ -257,12 +257,12 @@ export class UserProfile {
// Use the `Write` phase to write to a geometric property.
afterNextRender(() => {
nativeElement.style.padding = computePadding();
}, AfterRenderPhase.Write);
}, {phase: AfterRenderPhase.Write});
// Use the `Read` phase to read geometric properties after all writes have occured.
afterNextRender(() => {
this.elementHeight = nativeElement.getBoundingClientRect().height;
}, AfterRenderPhase.Read);
}, {phase: AfterRenderPhase.Read});
}
}
```