To create an Image Slider similar to the one shown here, I need to load images from a source. However, I'm unsure about where exactly in the file (possibly in the component.ts?) I should declare them:
imageObject: Array<object> = [{
image: 'assets/img/slider/1.jpg',
thumbImage: 'assets/img/slider/1_min.jpeg',
alt: 'alt of image',
title: 'title of image'
}, {
image: '.../iOe/xHHf4nf8AE75h3j1x64ZmZ//Z==', // Support base64 image
thumbImage: '.../iOe/xHHf4nf8AE75h3j1x64ZmZ//Z==', // Support base64 image
title: 'Image title', //Optional: You can use this key if want to show image with title
alt: 'Image alt' //Optional: You can use this key if want to show image with alt
}
];
Additionally, how should the function look like? The component intended to showcase the slideshow is called Carousel and has the following structure:
@Component({
selector: 'carousel',
templateUrl: './carousel.html',
styleUrls: ['./carousel.component.scss', '../profile.scss']
})
export class Carousel implements OnInit {
ngOnInit(): void {
}
Is it appropriate to declare the image object within the OnInit method?
Thank you very much!