Problem integrating the Jquery, bootstrap and Popper.Js scripts in angle 6

0

I have a problem integrating the bootstrap.js, popper.js, and jquery.js scripts into my Angular project. I've already made a few attempts, but nothing has resolved so far.

My scripts are being merged as follows:

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

One important note: The Bootstrap Css is loading correctly and working perfectly. I already tried to put a ./ to try to get the current directory reference.

    
asked by anonymous 01.09.2018 / 20:06

2 answers

1

Recommended and follow official documentation:

link

Another suggestion would be to use libraries such as ng-bootstrap .

    
06.09.2018 / 10:06
0

try the following:

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

Verify that the following steps were taken before

Bootstrap has dependency on Jquery and Popper js. To install Jquery and Popper js, enter the following commands.

To install jQuery type:

npm install jquery --save

Install popper.js with this:

npm install popper.js --save

And for Bootstrap 4, this one:

npm install ngx-bootstrap [email protected]

Reference (Second Method): link

    
04.09.2018 / 09:29