• 개요
@angular/platform-browser/animations/async

provideAnimationsAsync

함수
사용 중단 권고v20.2부터

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

사용 중단을 권고합니다.

Use animate.enter or animate.leave instead. Intent to remove in v23

API

function provideAnimationsAsync(
  type?: 'animations' | 'noop',
): EnvironmentProviders;
@deprecated

Use animate.enter or animate.leave instead. Intent to remove in v23

@paramtype"animations" | "noop"

pass 'noop' as argument to disable animations.

설명

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

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

사용 시 참고사항

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()
  ]
});
상세 내용으로 이동