0
There’s this slide of images in bootstrap, I want it to receive the images from the database (so far so good), but instead of displaying one by one it’s listing all at the same time.
that’s the slide:
{{#each Carousel}}
<div id="carouselExampleFade" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="{{imgCarousel}}" class="d-block w-100" >
<h5>{{textCarousel}}</h5>
</div>
<div class="carousel-item">
<img src="{{imgCarousel}}" class="d-block w-100" >
<h5>{{textCarousel}}</h5>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleFade" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleFade" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
{{else}}
<p>no image</p>
{{/each}}
this is their respective DB, written in document oriented, in case I used mongolDB:
const mongoose = require('mongoose')
const Schema = mongoose.Schema
const Carousel = new Schema({
imgCarousel:{
type: String,
required: true
},
textCarousel:{
type: String,
required: true
}
})
mongoose.model("carousel",Carousel)
You checked if you cared about jQuery and the files (js and css) of bootstrap on that page?
– Vinicius.Silva