请查找ng-zorro链接以供参考。https://ng.ant.design/components/carousel/en#header
使用ViewChild
获取组件实例并使用实例方法。
index = 0;
@ViewChild(NzCarouselComponent, { static: false }) myCarousel: NzCarouselComponent;
goTo() {
this.myCarousel.goTo(Number(this.index));
}
https://stackblitz.com/edit/angular-6rsuzz?file=src/app/app.component.ts