I know we need typings file for wow.js but I couldn't find it anywhere. Is there any other solution for loading this external js into webpack?
Asked
Active
Viewed 2,167 times
1 Answers
4
Do the following steps:
-
Install exports-loader
npm i exports-loader --save-dev
-
Add to
webpack.config.js
this loader{ test: require.resolve('wow.js/dist/wow.js'), loader: 'exports?this.WOW' }
-
Create
typings.d.ts
file in your typings folder:declare module "wow.js/dist/wow.js" { var noTypeInfoYet: any; export = noTypeInfoYet; }
-
add import to your
*.component.ts
fileimport * as WOW from 'wow.js/dist/wow.js';
- Use it well!
ngOnInit(){ new WOW().init(); }
Of course you can use your own webpack configuration without exports-loader
, etc...

Yury Scherbakov
- 260
- 3
- 10
-
Thank you for your answer. I'll try this as soon as I get my hands on Angular. – Tuna Yagci Aug 13 '16 at 08:39