Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx-wow library not working with Angular14 #77

Open
owiesomari3 opened this issue Mar 2, 2023 · 1 comment
Open

ngx-wow library not working with Angular14 #77

owiesomari3 opened this issue Mar 2, 2023 · 1 comment

Comments

@owiesomari3
Copy link

I'm trying to integrate a bootstrap template with angular project, this template uses wow.js library, so I tried to install this library as bellow:

1- install wow.js using npm

npm I wowjs
2- install nxg-wow

npm i ngx-wow
And in app.module.ts I added the NgwWowModule in imports:

import { NgwWowModule } from 'ngx-wow';
imports: [
BrowserModule,
HttpClientModule,
AppRoutingModule,
BrowserAnimationsModule,
NgxPaginationModule,
NgwWowModule,
MaterialModule,
FormsModule,
],
Then I added the reference in angular.json file under scripts[]:

"scripts": [
"./node_modules/wowjs/dist/wow.min.js",
"./node_modules/jquery/dist/jquery.js",
"./node_modules/bootstrap/dist/js/bootstrap.js"
]
Also in styles.css I added the animate.cs:

@import "~animate.css/animate.css";
Inside the component.ts I did the bellow:

import { Component, OnInit } from '@angular/core';
import { NgwWowService } from 'ngx-wow';

@component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {

constructor(private wowService: NgwWowService) {
this.wowService.init();
}
}
And then, I tired to use the wow's classes in HTML as bellow:

Our Core

Features

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore.

But the animation not applied to the elements, so any advice please?
@rasikasampath
Copy link

faced the same issue, resolved by including the wow.js Javascript.

Added animate.css and wow.js (Javascript version) to the angular.json file

Add following to the import section to the component

declare var WOW: any;

then at ngOnInit of the component

ngOnInit(){
    (new WOW()).init();
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants