ng-lottie and ngx-lottie is not working in ionic-5

Viewed 1444

I am integrating the lottie splash animation to my component in ionic 5 framework.

I have installed the ng-lottie using npm install --save ng-lottie and followed the steps in the docs https://www.npmjs.com/package/ng-lottie. But, it shows the below error. Please help me to resolve this issue.

Uncaught Error: Template parse errors:
Can't bind to 'options' since it isn't a known property of 'lottie-animation-view'.
1. If 'lottie-animation-view' is an Angular component and it has 'options' input, then verify that it is part of this module.
2. If 'lottie-animation-view' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

<lottie-animation-view
                    [ERROR ->][options]="lottieConfig"
                    [width]="300"
                    [height]="600"
"): ng:///SsoModule/SsoComponent.html@13:20
Can't bind to 'width' since it isn't a known property of 'lottie-animation-view'.
2 Answers

You have to also import LottieModule in your '.module.ts component

@NgModule({
  imports: [
   ***,
    LottieModule
  ],

This error is common when you add the dependency in app.module.ts and not in your module.ts. Try to change dependecies.

Related