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
BrowserModule
have already been loaded. If you need access to common directives such as NgIf and NgFor, import theCommonModule
instead.
and when I remove it this one:
Unexpected synthetic listener @animation.start found. Please make sure that: Either
BrowserAnimationsModule
orNoopAnimationsModule
are 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?
You have provideAnimations()
for this !
bootstrapApplication(AppComponent, {
providers: [
provideAnimations()
]
})