Angular 如何在dx Gallery中绑定数据源?

Angular 如何在dx Gallery中绑定数据源?,angular,devextreme,devextreme-angular,Angular,Devextreme,Devextreme Angular,数据源需要绑定到更嵌套的循环中 <div *ngFor="let singleImg of training.exercise.pictureList; let t = index"> <dx-gallery #gallery id="gallery" [dataSource]="singleImg.url" [loo

数据源需要绑定到更嵌套的循环中

        <div *ngFor="let singleImg of training.exercise.pictureList; let t = index">
          <dx-gallery #gallery  
          id="gallery"
          [dataSource]="singleImg.url" 
          [loop]="true"
          [height]="300"
          [showNavButtons]="true"
          [showIndicator]="true"
      ></dx-gallery>
        </div>

我在训练前有一个循环。锻炼。图片列表,但这对你来说并不重要。 我知道在这里循环使用.ts文件并绑定数组,但总是打印相同的照片。。。
根据devextreme的文档,数据源是每个图像的url字符串数组

例如:

[dataSource] = [
    "images/gallery/1.jpg",
    "images/gallery/2.jpg",
    "images/gallery/3.jpg",
    "images/gallery/4.jpg",
    "images/gallery/5.jpg",
    "images/gallery/6.jpg",
    "images/gallery/7.jpg",
    "images/gallery/8.jpg",
    "images/gallery/9.jpg"];
您可以尝试删除div元素并将数组直接提供给数据源,如:

<dxGalley 
[dataSource]= "training.exercise.pictureList";>

Friend这不是工作[dataSource]=“培训。锻炼。图片列表”>试试这个->