In my ts file, I have defined an array named "myimages" that contains the paths to several images.
myimages: any=[
{img_path:"assets/img/image1.jpg"},
{img_path:"assets/img/image2.jpg"},
{img_path:"assets/img/image3.jpg"},
{img_path:"assets/img/image4.jpg"},
{img_path:"assets/img/image5.jpg"},
{img_path:"assets/img/image6.jpg"},
{img_path:"assets/img/image7.jpg"},
{img_path:"assets/img/image8.jpg"},
{img_path:"assets/img/image9.jpg"},
{img_path:"assets/img/image10.jpg"}
];
galleryImages = [
for (let i = 0; i < myimages.length; i++) {
small: 'myimages[i]',
medium: 'myimages[i]',
big: 'myimages[i]'
}
];
I am looking to assign the image paths from the "myimages" array into the small, medium and big values within the "galleryImages" array. However, when I tried the above code, I encountered a ts1137 error related to the for loop syntax. As a newcomer to Angular, I am struggling to find a solution. Any help would be greatly appreciated. Thank you in advance.