Angular4 can't find Jquery-UI functions

后端 未结 3 470
猫巷女王i
猫巷女王i 2020-12-17 03:13

I have installed Jquery and Jquery-ui

npm install --save jquery jquery-ui

The files are in the node_modules directory. I have a component t

3条回答
  •  旧时难觅i
    2020-12-17 03:33

    The solution to define jquery-ui in angular-cli.json (and avoid to add it in index.html) is:

    1 : Import jquery-ui-dist

        npm install jquery jquery-ui-dist
    

    2: Add scripts in angular-cli.json

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

    Source : https://stackoverflow.com/a/38795318

提交回复
热议问题