Skip to content

Commit 3f29481

Browse files
refactor(core): Updates animate.enter queue comment for clarity
This updates the comment details about why we have to queue animations inside the animateEnter instructions and should help anyone needing to update this code in the future.
1 parent c1d870b commit 3f29481

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/core/src/render3/instructions/animation.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ export function ɵɵanimateEnter(value: string | Function): typeof ɵɵanimateEn
7777

7878
initializeAnimationQueueScheduler(lView[INJECTOR]);
7979

80-
// TODO(thePunderWoman): it's unclear why we need to queue animations here, but without this,
81-
// animating through host bindings fails
80+
// We queue here for nodes that have enter animations and are not inside control flow. These elements
81+
// are just a normal node in a template and would need to be queued here. Nodes that are inside control flow
82+
// or otherwise enter the DOM post-render have enter animations queued in node_manipulation.ts.
8283
queueEnterAnimations(lView[INJECTOR], getLViewEnterAnimations(lView));
8384

8485
return ɵɵanimateEnter; // For chaining
@@ -202,8 +203,9 @@ export function ɵɵanimateEnterListener(value: AnimationFunction): typeof ɵɵa
202203

203204
initializeAnimationQueueScheduler(lView[INJECTOR]);
204205

205-
// TODO(thePunderWoman): it's unclear why we need to queue animations here, but without this,
206-
// animating through host bindings fails
206+
// We queue here for nodes that have enter animations and are not inside control flow. These elements
207+
// are just a normal node in a template and would need to be queued here. Nodes that are inside control flow
208+
// or otherwise enter the DOM post-render have enter animations queued in node_manipulation.ts.
207209
queueEnterAnimations(lView[INJECTOR], getLViewEnterAnimations(lView));
208210

209211
return ɵɵanimateEnterListener;

0 commit comments

Comments
 (0)