You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this will eagerly load the animations package with the main bundle, which can slow down the initial load time of your application.
22
22
The unminified size of the animations package is around **65kb**, which is not a lot, but it can add up with other packages.
23
23
24
-
25
24
# Solution
26
25
27
-
Starting with Angular **17.0.0**, you can now lazy load the animation package.
28
-
You can change the way you provide the animations package in favor of `provideAnimationsAsync()`:
26
+
Starting with Angular **17.0.0**, you can now lazy load the animation package. You can change the way you provide the animations package in favor of `provideAnimationsAsync()`:
> **Note:** This behavior will only work if you use the animations in lazy loaded components. Otherwise, the animations will be eagerly loaded with the main bundle.
39
+
**Note:** This behavior will only work if you use the animations in lazy loaded components. Otherwise, the animations will be eagerly loaded with the main bundle.
42
40
43
41
# Resources
44
42
45
-
-[Lazy-loading Angular's animation module](https://riegler.fr/blog/2023-10-04-animations-async) by Matthieu Riegler
46
-
43
+
-[Lazy-loading Angular's animation module](https://riegler.fr/blog/2023-10-04-animations-async) by [Matthieu Riegler](https://twitter.com/Jean__Meche)
0 commit comments