Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

provideAnimationsAsync

Returns the set of dependency-injection providers to enable animations in an application. See animations guide to learn more about animations in Angular.

See more...

      
      provideAnimationsAsync(type: "animations" | "noop" = 'animations'): EnvironmentProviders
    
Parameters
type "animations" | "noop"

pass 'noop' as argument to disable animations.

Optional. Default is 'animations'.

Returns

EnvironmentProviders

Description

When you use this function instead of the eager provideAnimations(), animations won't be renderered until the renderer is loaded.

Further information is available in the Usage Notes...

Usage notes

The function is useful when you want to enable animations in an application bootstrapped using the bootstrapApplication function. In this scenario there is no need to import the BrowserAnimationsModule NgModule at all, just add providers returned by this function to the providers list as show below.

      
      bootstrapApplication(RootComponent, {
  providers: [
    provideAnimationsAsync()
  ]
});