I've been trying to use ngx-lottie at my Angular 17 app.
I've tried this
import { LottieModule } from 'ngx-lottie';
export function playerFactory() {
return import('lottie-web');
}
@NgModule({
declarations: ['...'],
imports: [
LottieModule.forRoot({ player: playerFactory })
]})
But it's says "LottieModule" doesn't exist.
Github Link I've checked also the documentation at their github account but it looks like they don't support NgModule now because the examples are for stand alone. Correct me if I am wrong or is there any other way to use this at NgModule?
Thank you.
Here is a sample implementation of
ngx-lottiein angular 17, I followed the getting started guide and it works great!main.ts
stackblitz demo
reference stackblitz that was used(not by me)!
To perform lazy loading, we can use the below code!
stackblitz demo
for modules please do the below changes!
code
stackblitz demo