From 99be5ea9395ca4cb1026fba9945cfbe6c3eff8a9 Mon Sep 17 00:00:00 2001 From: Vlad Tansky Date: Thu, 16 Dec 2021 11:50:13 +0200 Subject: [PATCH] fix(angular): setElement call updateInitSwiper bug (#5296) * fix(angular): setElement call updateInitSwiper bug --- src/angular/src/swiper.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/angular/src/swiper.component.ts b/src/angular/src/swiper.component.ts index d19ce9d3e..549214095 100644 --- a/src/angular/src/swiper.component.ts +++ b/src/angular/src/swiper.component.ts @@ -459,7 +459,8 @@ export class SwiperComponent implements OnInit { ) {} private _setElement(el: ElementRef, ref: any, update: string, key = 'el') { - if (ref && el && el.nativeElement) { + if (!ref && !el) return; + if (el.nativeElement) { if (ref[key] === el.nativeElement) { return; }