0

I can't get Angular Animations to work on my standalone components which I posted another question about here a couple weeks ago. I'm trying to create a stackblitz demo to add to it as well as get help from others elsewhere which can be viewed here. When I add the BrowserAnimationsModule to the app I get the error and it goes on to say

Providers from the BrowserModule have already been loaded. If you need access to common directives such as NgIf and NgFor, import the CommonModule instead.

I came across another question on here about that error and the answer was to use the NoopAnimationsModule instead so I tried that and still got the same error. Does anybody know why this is happening and how to fix it?

Optiq
  • 2,835
  • 4
  • 33
  • 68

1 Answers1

1

I found the solution. in the main.ts file I need to add the provideAnimations() method to a providers array in the bootstrapApplication() method like this

bootstrapApplication(App,{
  providers:[
    provideAnimations()
  ]
});
Optiq
  • 2,835
  • 4
  • 33
  • 68