admin管理员组文章数量:1225724
I am trying to get WOW.js working in my Angular project but it is not working yet. I am not using webpack so I think the next thread is not answering my question: How to use WOW.js in Angular 2 Webpack?.
The steps that I took until now:
- I installed the wow.js module.
npm install wowjs
I added the wowjs files to '.angular-cli.json'.
"styles": [ "../node_modules/wowjs/css/libs/animate.css" ],
"scripts": [ "../node_modules/wowjs/dist/wow.js" ]
3.Then I added a wow effect to one of my headers.
<h1 class="wow slideInLeft" data-wow-duration="2s">Wow effect!</h1>
- And the next thing I did was rebuilding and serving my project.
ng build
ng serve
- There is no wow effect yet. Does somebody know what I have to do yet?
I am trying to get WOW.js working in my Angular project but it is not working yet. I am not using webpack so I think the next thread is not answering my question: How to use WOW.js in Angular 2 Webpack?.
The steps that I took until now:
- I installed the wow.js module.
npm install wowjs
I added the wowjs files to '.angular-cli.json'.
"styles": [ "../node_modules/wowjs/css/libs/animate.css" ],
"scripts": [ "../node_modules/wowjs/dist/wow.js" ]
3.Then I added a wow effect to one of my headers.
<h1 class="wow slideInLeft" data-wow-duration="2s">Wow effect!</h1>
- And the next thing I did was rebuilding and serving my project.
ng build
ng serve
- There is no wow effect yet. Does somebody know what I have to do yet?
1 Answer
Reset to default 18You will need to initialise WOW for your component.
In the component where you plan on using WOW, import the script
import { WOW } from 'wowjs/dist/wow.min';
then in your class with the Angular method ngAfterViewInit
class ngAfterViewInit(){
new WOW().init();
}
本文标签: javascriptHow to setup WOWjs in Angular 2 and 4Stack Overflow
版权声明:本文标题:javascript - How to setup WOW.js in Angular 2 and 4? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739462542a2164212.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论