最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to setup WOW.js in Angular 2 and 4? - Stack Overflow

programmeradmin0浏览0评论

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:

  1. I installed the wow.js module.

npm install wowjs

  1. 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>
  1. And the next thing I did was rebuilding and serving my project.

ng build

ng serve

  1. 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:

  1. I installed the wow.js module.

npm install wowjs

  1. 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>
  1. And the next thing I did was rebuilding and serving my project.

ng build

ng serve

  1. There is no wow effect yet. Does somebody know what I have to do yet?
Share Improve this question asked Jun 9, 2017 at 10:00 KlynerKlyner 4,1634 gold badges32 silver badges57 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 18

You 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();
 }
发布评论

评论列表(0)

  1. 暂无评论