Navbar drop-down menu not working with Angular and Bootstrap 4

前端 未结 6 2185
暗喜
暗喜 2020-12-17 17:09

I\'m developing a web application with Angular 5 and Bootstrap 4 and I\'m having problems with the nav menu bar dropdowns. I\'m following the documentation https://getbootst

6条回答
  •  粉色の甜心
    2020-12-17 17:45

    make sure you have installed jquery in your root folder

    if not then install using NPM ---> npm install jquery --save

    Note: If you want to use bootstrap in your application, or if you already have in your project, make sure to include jQuery before including the bootstrap JavaScript file. Bootstrap’s JavaScript file requires jQuery

    go to the angular.json file at the root of your Angular CLI project folder, and find the scripts: [ ] property, and include the path to jQuery as follows:

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

提交回复
热议问题