use browser animations module in my library

1.3k Views Asked by At

I have to used browser animations module in my angular library because of my date picker and I am using lazy loading so I got several modules in my project when I want import my library in my modules I get this common error "Lazy Loading BrowserModule has already been loaded". is there any way to fix it? thanks a lot

1

There are 1 best solutions below

0
On

try to add :

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
            
  @NgModule({
      imports: [
         BrowserAnimationsModule
      ],
      declarations: [ ],
      bootstrap: [ ]
  })

in your appModule and remove the import of BrowserAnimationsModule from anywhere else.