首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ng-lottie和ngx-lottie在ionic-5中不起作用

ng-lottie和ngx-lottie在ionic-5中不起作用
EN

Stack Overflow用户
提问于 2020-08-12 22:33:48
回答 2查看 868关注 0票数 1

我正在将lottie splash动画集成到ionic 5框架中的组件中。

我已经使用npm install --save ng-lottie安装了ng-lottie,并遵循了文档https://www.npmjs.com/package/ng-lottie中的步骤。但是,它显示了下面的错误。请帮我解决这个问题。

代码语言:javascript
复制
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'.
EN

回答 2

Stack Overflow用户

发布于 2021-10-24 17:46:35

您还必须在'.module.ts组件中导入LottieModule

代码语言:javascript
复制
@NgModule({
  imports: [
   ***,
    LottieModule
  ],
票数 0
EN

Stack Overflow用户

发布于 2020-11-19 04:32:11

当您在app.module.ts中而不是在module.ts中添加依赖项时,此错误很常见。尝试更改依赖项。

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63378784

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档