Dropdown does not work on angular 5

0

I am developing an app in angle 5 and I have 2 dropdown of bootstrap (as shown in the image). the point is that the first one works fine but the second when clicking it gives the following error:

Uncaught TypeError: Bootstrap dropdown require Popper.js (https://popper.js.org)
at c.t.toggle (scripts.bundle.js:9)
at HTMLButtonElement.<anonymous> (scripts.bundle.js:9)
at Function.each (scripts.bundle.js:2)
at w.fn.init.each (scripts.bundle.js:2)
at w.fn.init.c._jQueryInterface [as dropdown] (scripts.bundle.js:9)
at HTMLButtonElement.<anonymous> (scripts.bundle.js:9)
at HTMLDocument.dispatch (scripts.bundle.js:2)
at HTMLDocument.y.handle (scripts.bundle.js:2)
at ZoneDelegate.invokeTask (zone.js:421)
at Zone.runTask (zone.js:188)

I am using bootstrap 4.1.3 and jquery 3.3.1

    
asked by Bryan G. 20.10.2018 в 08:46
source

1 answer

2

I think you're missing the popper.js library.

To install it, enter the following command:

npm install popper.js --save

Verify the following records in the file angular.json :

"scripts": [  "./node_modules/jquery/dist/jquery.slim.min.js",
              "./node_modules/popper.js/dist/umd/popper.min.js"]
    
answered by 24.10.2018 в 18:18