gpt4 book ai didi

angular - 无法绑定(bind)到 'countUp',因为它不是 'h1' 的已知属性。 countup.js-angular2

转载 作者:行者123 更新时间:2023-12-02 00:13:12 31 4
gpt4 key购买 nike

我想在我的一个组件中进行计数...使用 countup.js-angular2

在 gitup 仓库中,我做了我应该做的一切,它仍然没有工作

import { CountUpModule } from 'countup.js-angular2';

@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
.....,
CountUpModule
],
})

html
<h1 [countUp]="endVal">0</h1>

typescript
endVal: number = 100;

错误-

Can't bind to 'countUp' since it isn't a known property of 'h1'.

最佳答案

寻找 at the docs他们似乎忽略了 Ionic 使用延迟加载并且每个页面也是一个模块这一事实。

将模块添加到您的 (pagename).module.ts 文件中,使用与 app.module.ts 相同的方式。

关于angular - 无法绑定(bind)到 'countUp',因为它不是 'h1' 的已知属性。 countup.js-angular2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58168597/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com