How to use jQuery UI with Angular 2

前端 未结 5 2195
旧巷少年郎
旧巷少年郎 2020-12-06 01:18

Because I want to incorporate Drag and Drop functionality in my app, I decided to import jQuery UI to my Angular 2 project.

First I started by importing jQuery itse

5条回答
  •  Happy的楠姐
    2020-12-06 01:51

    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.

提交回复
热议问题