Display multiple images not getting


#1

not getting how do I display multiple images
ts file is

var imagesSrc = ["../../assets/images/01.jpg", "../../assets/images/02.jpg", "../../assets/images/03.jpg"];

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})

export class HomePage {
  constructor(public navCtrl: NavController) {
    var loadImages = [];
    for (var i = 0; i < imagesSrc.length; i++) {
      loadImages.push({"src" : imagesSrc[i]});
    }
  }

html file

 <ion-scroll direction="x" style="height:200px; min-height: 200px;">
      <img ng-repeat="image in images" src="{{loadImages.src}}"/>
    </ion-scroll>

#2

You have an array imagesSrc that you iterate over and then push into loadImages in your Controller. Then you iterate over some images object (that doesn’t exist) in your HTML code and output a src of an array of loadImages (which doesn’T exist, as it contains lots of objects with value src).

Switch that around a bit so it makes sense and it should work.


#3

I just saw an example I don’t know actually how to iterate in html and paas that array to html I went through many examples but don’t know where I am going wrong