I have an angular project in which I try to use the dropdown navbar from bootstrap. I have litteraly copied this from https://getbootstrap.com/docs/4.0/components/navbar/ and the dropdown doesn't work with me:
//also tried it within <head> tags and with all different proposals I found in other questions.
<script src="https://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown link
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
</div>
</nav>
I cannot seem to figure out why. I have bootstrap 5.2.1, jquery 3.6.1 and I also added popper 1.16.1 and added it to my styles.css. This doesn't change anything. Although I don't even think this should be necessary. Also I tried adding direct imports in css or in the html following this article: Navbar drop-down menu not working with Angular and Bootstrap 4. It didn't help. I cannot find any other necessary requirements to make this work.
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/@ng-select/ng-select/themes/default.theme.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"
]
relevant dependencies:
"@ng-bootstrap/ng-bootstrap": "^13.1.0",
"bootstrap": "^5.2.1",
"jquery": "^3.6.1",
"popper.js": "^1.16.1",
What configuration is required/necessary to make the bootstrap dropdownlist work?