我已经为bootstrap3轮播实现了相同的代码形式w3school。但是滑块不起作用。 Bootstrap.js和bootstrap.css已经实现,我正尝试在angular5中做到这一点:
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
<li data-target="#myCarousel" data-slide-to="4"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="../../assets/img/pic18.jpg" alt="">
</div>
<div class="item">
<img src="../../assets/img/pic19.jpg" alt="">
</div>
<div class="item">
<img src="../../assets/img/pic20.jpg" alt="">
</div>
<div class="item">
<img src="../../assets/img/pic21.jpg" alt="">
</div>
<div class="item">
<img src="../../assets/img/pic22.jpg" alt="">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>