【发布时间】:2018-04-06 10:29:19
【问题描述】:
我之前从未使用过这个库,希望有人可以帮助我,
好的,所以我正在尝试使用 ngx-wow 库,但我无法让它工作.. 所以请按照说明进行操作
我跑了yarn add wowjs
我添加到angular-cli.json
"scripts": [
"../node_modules/wowjs/dist/wow.js"
]
我还以同样的方式将animate.css 添加为全局依赖项
"styles": [
"../node_modules/animated.css/animate.css"
]
然后我按照这样的说明安装ngx-wow..
`yarn add ngx-wow`
然后在我的主模块中我导入了ngwWowModule
import { NgwWowModule } from 'ngx-wow';
@NgModule({
declarations: [...],
imports: [NgwWowModule.forRoot(), ...],
bootstrap: [...]
})
然后在我要使用wow.js的组件中
import { NgwWowService } from 'ngx-wow';
...
constructor (
private wowService: NgwWowService
)
ngOnInit() {
this.wowService.init();
}
在我的组件 html 中
<div class="wow fadeIn"></div>
但我无法让它在我的控制台中运行我收到此错误...
我不确定我做错了什么,任何帮助将不胜感激!
【问题讨论】:
标签: javascript angular typescript wow.js