Angular 4 Bootstrap dropdown require Popper.js

前端 未结 4 2123
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 09:28

I have a fresh created Angular 4 CLI app. After running this:

npm install bootstrap@4.0.0-beta jquery popper.js --save

and editing .angular

4条回答
  •  温柔的废话
    2020-12-23 09:48

    Was same issue, when I updated app to 8 version of Angular. As solution can use bootstrap bundle minified js file instead bootstrap.min.js. Bootstrap bundle included popper.js already. Need to fix angular.json (scripts array in build section), in final will be something like this:

    "scripts": [
        "./node_modules/jquery/dist/jquery.min.js",
        "./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js",
    ],
    

    For this solution popper.js is not needed in project. Can remove this module:

    npm uninstall popper.js
    

    just in case, jquery needed :)

    Hope, help you

提交回复
热议问题