I have installed bootstrap 3 in my angular 4 project using the npm installer. I have a basic site done up and am trying to get an dynamic sideNav bar that will toggle in and out.
I have seen some examples online however they do not seem to work whether it be a newer version of bootstrap or compatibility issues with angular.
Does anyone have any recommendations for a navigation bar that I could use in this instance?
The HTML in my app.component.html
:
<!-- Sidebar -->
<script src="src/Javascript/sidebar.js"></script>
<nav class="navbar navbar-inverse navbar-fixed-left" id="sidebar-wrapper" role="navigation">
<ul class="nav sidebar-nav">
<li class="sidebar-brand">
<a href="#">
Brand
</a>
</li>
<li>
<a href="#">Home</a>
</li>
<li>
<a href="#">About</a>
</li>
<li>
<a href="#">Events</a>
</li>
<li>
<a href="#">Team</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Works <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Clients</a></li>
<li><a href="#">Contact</a></li>
</ul>
</li>
<li>
<a href="#">Services</a>
</li>
<li>
<a href="#">Contact</a>
</li>
</ul>
</nav>
First You need to Import bootstrap 3 or Use Bootstrap 3 CDN
Then Instead of using JQuery Use Directive to manipulate Class and Style of Side Bar
I Have Created Stack blitz for same side Bar without using JQuery Check this: https://stackblitz.com/edit/angular-z6hrob
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With