diff --git a/playground/angular/src/app/home/home.component.html b/playground/angular/src/app/home/home.component.html
index 84f980a02..0dd418d9e 100644
--- a/playground/angular/src/app/home/home.component.html
+++ b/playground/angular/src/app/home/home.component.html
@@ -114,7 +114,6 @@
Custom pagination
[breakpoints]="breakpoints"
[scrollbar]="scrollbar"
[loop]="true"
- [(index)]="indexNumber"
[pagination]="{ el: '.swiper-pagination.pagination-test' }"
>
@@ -134,11 +133,6 @@ Custom pagination
-
-
-
-
- {{ indexNumber }}
Best slide ever 2
diff --git a/playground/angular/src/app/home/home.component.ts b/playground/angular/src/app/home/home.component.ts
index 42ff07838..aabe19cf9 100644
--- a/playground/angular/src/app/home/home.component.ts
+++ b/playground/angular/src/app/home/home.component.ts
@@ -56,7 +56,6 @@ export class HomePage {
this.controlledSwiper = swiper;
}
- indexNumber = 1;
exampleConfig = { slidesPerView: 3 };
slidesPerView: number = 4;
pagination: any = false;
diff --git a/src/angular/src/swiper.component.ts b/src/angular/src/swiper.component.ts
index e81ba2624..3a7ef4a06 100644
--- a/src/angular/src/swiper.component.ts
+++ b/src/angular/src/swiper.component.ts
@@ -234,6 +234,7 @@ export class SwiperComponent implements OnInit {
@Input()
set index(index: number) {
+ console.warn('`[(index)]` prop is deprecated and will be removed in upcoming versions');
this.setIndex(index);
}
@Input()
@@ -821,8 +822,11 @@ export class SwiperComponent implements OnInit {
} else {
this.swiperRef.params[_key] = value;
}
+ this.setIndex(2);
}
-
+ /**
+ * @deprecated will be removed in upcoming versions
+ */
setIndex(index: number, speed?: number, silent?: boolean): void {
if (!this.isSwiperActive) {
this.initialSlide = index;