How To Implement Bootstrap Scrollspy In Angular 6?
My code runs with Angular 6 and and Bootstrap 4. In the end I want to have bootstrap's scrollspy component running in this setup. Bootstrap requires jQuery and I do not know how to
Solution 1:
Try this code, it would be better if you built a working example on sites like codepen or stackblitz. that will make us easy to see the problem.
<header>
<div class="header-nav" data-spy="scroll" data-target=".navbar">
<nav id="home-nav" class="navbar navbar-expand-md navbar-light bg-white fixed-top">
<a class="navbar-brand" href="#">Dashboard</a>
<button class="navbar-toggler d-lg-none" type="button" data-toggle="collapse" data-target="#navbar_header"
aria-controls="navbar_header" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar_header">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#home">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#our_mission">Our Mission</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#our_clients">our clients</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#features">features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#pricing">pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#faqs">Faqs</a>
</li>
</ul>
</div>
</nav>
</div>
</header>
<div class="main-content">
<section id="home">
<div class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="../../../assets/landing-page/images/slider-1.jpg" width="100%">
</div>
<div class="carousel-item">
<img src="../../../assets/landing-page/images/slider-1.jpg" width="100%">
</div>
<div class="carousel-item">
<img src="../../../assets/landing-page/images/slider-1.jpg" width="100%">
</div>
</div>
</div>
</section>
<section id="our_mission">
<p>AAAAAAAAAA</p>
</section>
<section id="our_clients"></section>
<section id="features"></section>
<section id="pricing"></section>
<section id="faqs"></section>
</div>
Post a Comment for "How To Implement Bootstrap Scrollspy In Angular 6?"