For my latest project, I wanted to incorporate dropdown menus. I found a code snippet on a website and implemented it. However, although the dropdown menu appeared as expected, I encountered an issue where clicking on it did not trigger any actions.
<li class="dropdown">
<a [routerLink]="['/frontendai']" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Application Insights <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a [routerLink]="['/frontendai']">FrontEnd AI</a></li>
<li class="divider"></li>
<li><a [routerLink]="['/apiai']">API AI</a></li>
<li class="divider"></li>
<li><a [routerLink]="['/apiai']">SQL Exception</a></li>
</ul>
</li>
Using Bootstrap version 3.3.7, I made changes to my index.cshtml by adding the following lines:
<link href="node_modules/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
Any tips on effectively utilizing Bootstrap dropdowns in an Angular 2 project?