Angular 16 is recently released and I have created a new standalone project without any module.
then in a standalone component I need to import BrowserAnimationsModule from angular/platform-browser/animations. but when I import it, this error occures:
Poviders from the
BrowserModulehave already been loaded. If you
need access to common directives such as NgIf and NgFor, import the
CommonModuleinstead.
and when I remove it this one:
Unexpected synthetic listener @animation.start found. Please make sure
that: EitherBrowserAnimationsModuleorNoopAnimationsModuleare
imported in your application.
so why first error occures? where is BrowserModule already loaded? and if it has already been imported how do I use it?
>Solution :
You have provideAnimations() for this !
bootstrapApplication(AppComponent, {
providers: [
provideAnimations()
]
})