From 3e56ae223a58307973d4974effe8c1f8f2064d8a Mon Sep 17 00:00:00 2001 From: Egor Volvachev Date: Sun, 16 Oct 2022 12:07:23 +0300 Subject: [PATCH] fix(primeng/p-carousel): carousel wrong pagination, if data is loaded dynamically Fixes #12043. --- src/app/components/carousel/carousel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/carousel/carousel.ts b/src/app/components/carousel/carousel.ts index 2fb40228f96..63a78571cc0 100755 --- a/src/app/components/carousel/carousel.ts +++ b/src/app/components/carousel/carousel.ts @@ -480,7 +480,7 @@ export class Carousel implements AfterContentInit { } totalDots() { - return this.value ? Math.ceil((this.value.length - this._numVisible) / this._numScroll) + 1 : 0; + return this.value?.length ? Math.ceil((this.value.length - this._numVisible) / this._numScroll) + 1 : 0; } totalDotsArray() {