Bootstrap 4 转到角度引导旋转木马的最后添加图像

Bootstrap 4 转到角度引导旋转木马的最后添加图像,bootstrap-4,carousel,angular6,ng-bootstrap,Bootstrap 4,Carousel,Angular6,Ng Bootstrap,我正在使用angular6和 我单击一个按钮,动态地向旋转木马添加一个新图像,然后我希望旋转木马实际转到最后一个图像 这是我添加新图像的代码 addpic(){ //images is an array of json objs this.images.push({'link':'https://picsum.photos/900/500/?image=7','name':'added one'}); let slide = 'ngb-slide-'

我正在使用angular6和

我单击一个按钮,动态地向旋转木马添加一个新图像,然后我希望旋转木马实际转到最后一个图像

这是我添加新图像的代码

  addpic(){
      //images is an array of json objs
      this.images.push({'link':'https://picsum.photos/900/500/?image=7','name':'added one'});   
      let slide = 'ngb-slide-'+String(this.images.length);        
      this.carousel.select(slide);              
  }
slideId
遵循
ngb-slide-0
的模式,因此要转到最后一张幻灯片,我创建了
slideId
,并使用
选择
转到那里

但是这不起作用,即使实际添加了新图像并且
this.carousel.select()
将用于其他现有图像,如
this.carousel.select('ngb-slide-1')

我试过一个愚蠢的解决办法,比如

  addpic(){
      //images is an array of json objs
      this.images.push({'link':'https://picsum.photos/900/500/?image=7','name':'added one'});         
      this.carousel.select('ngb-slide-0');              
      this.carousel.prev();
  }
但它会转到加法之前的最后一个图像,然后转到加法之前的图像

如何转到新添加的最后一张图像

谢谢