使用ngu-carousel Angular 7的图像滑块

时间:2019-02-19 13:26:08

标签: angular carousel

我在Angular 7中使用ngu-carousel创建了一个图像滑块。图像随机旋转,有时出现相同的图像。但是我需要根据顺序旋转图像。 enter image description here

我的代码如下。

ngOnInit() {
    this.tempData = [];
    this.carouselTileItems$ = interval(500).pipe(
      startWith(-1),
      take(30),
      map(val => {
        const data = (this.tempData = [
          ...this.tempData,
          this.imgags[Math.floor(Math.random() * this.imgags.length)]
        ]);
        return data;
      })
    );
  }

如何根据我的要求更改此代码。

0 个答案:

没有答案