diff --git a/ionic/components/slides/slides.ts b/ionic/components/slides/slides.ts index e71acaef713..6a1711ed5b3 100644 --- a/ionic/components/slides/slides.ts +++ b/ionic/components/slides/slides.ts @@ -72,6 +72,9 @@ import {Scroll} from '../scroll/scroll'; '
' + '', directives: [NgClass], + host: { + '[id]': 'slideId' + }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, }) @@ -82,6 +85,16 @@ export class Slides extends Ion { */ public rapidUpdate: Function; + /** + * @private + */ + private id: number; + + /** + * @private + */ + private slideId: string; + /** * @private */ @@ -204,6 +217,9 @@ export class Slides extends Ion { this.rapidUpdate = debounce(() => { this.update(); }, 10); + + this.id = ++slidesId; + this.slideId = 'slides-' + this.id; } /** @@ -216,8 +232,10 @@ export class Slides extends Ion { this.showPager = isTrueProperty(this.pager); + let paginationId = '#' + this.slideId + ' .swiper-pagination'; + var options = defaults({ - pagination: '.swiper-pagination', + pagination: paginationId, }, this.options); options.onTap = (swiper, e) => { @@ -706,3 +724,5 @@ export class Slide { } }) export class SlideLazy {} + +let slidesId = -1;