0

In my node js application , I have installed jquery node module. In order to use jquery in my angular2 components I have to include below statement in ALL my components.

const $ = global.jQuery = require('jquery');

I am using webpack for module loading.

My question is Is this the correct way of implemention

OR

should I follow any other approach ?

refactor
  • 13,954
  • 24
  • 68
  • 103
  • http://stackoverflow.com/questions/39599997/how-to-use-vendor-ts-from-https-angular-io-docs-ts-latest-guide-webpack-html – yurzui Sep 22 '16 at 14:53
  • http://stackoverflow.com/questions/39637260/how-to-add-jquery-plugins-using-webpack#answer-39638594 – yurzui Sep 22 '16 at 15:03
  • @yurzui [this](http://stackoverflow.com/questions/28969861/managing-jquery-plugin-dependency-in-webpack) link is helpfull – refactor Sep 22 '16 at 15:18
  • Thanks :) So you have answered your own question – yurzui Sep 22 '16 at 15:34

0 Answers0