Angular 4 Bootstrap dropdown require Popper.js Angular 4 Bootstrap dropdown require Popper.js angular angular

Angular 4 Bootstrap dropdown require Popper.js


Include popper.js before bootstrap.js:

"scripts": [  "node_modules/jquery/dist/jquery.slim.min.js",  "node_modules/popper.js/dist/umd/popper.min.js",  "node_modules/bootstrap/dist/js/bootstrap.min.js"],


For Angular 7

npm install bootstrap jquery popper.js --save

       "styles": [          "src/styles.scss",          "node_modules/bootstrap/dist/css/bootstrap.min.css"        ],        "scripts": [          "node_modules/jquery/dist/jquery.slim.min.js",          "node_modules/bootstrap/dist/js/bootstrap.min.js",          "node_modules/popper.js/dist/umd/popper.min.js"        ],


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