我试图让WOW.js在我的Angular项目中工作,但它还没有工作 . 我没有使用webpack所以我认为下一个帖子没有回答我的问题:How to use WOW.js in Angular 2 Webpack? .
到目前为止我采取的步骤:
- 我安装了wow.js模块 .
npm install wowjs
- 我将wowjs文件添加到'.angular-cli.json' .
“styles”:[“../ node_modules / wowjs / css / libs / animate.css”],
“scripts”:[“../ node_modules/wowjs/dist/wow.js”]
然后,我在其中一个 Headers 中添加了哇效果 .
<h1 class="wow slideInLeft" data-wow-duration="2s">Wow effect!</h1>
- 我接下来要做的就是重建和服务我的项目 .
ng build ng serve
- 还没有惊人的效果 . 有人知道我要做什么吗?
1 回答
您需要初始化组件的WOW .
在您计划使用WOW的组件中,导入脚本
然后在你的 class 使用Angular方法ngAfterViewInit