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:
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>
ng build
ng serve
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();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With