How to use jQuery UI with Angular 2

I managed to make it work by doing the following steps:

  1. npm uninstall jquery jquery-ui
  2. npm cache clean
  3. npm install jquery jquery-ui
  4. In angular-cli.json I added my jquery and jquery-ui paths in the scripts object. Here is what they look:

    "scripts": [
    "../node_modules/jquery/dist/jquery.min.js",
    "../node_modules/jquery-ui/jquery-ui.js"
    ]

After I completed these steps, it worked like a charm. Hope that helps someone who had problems with it.

Leave a Comment