Skip to content

Commit

Permalink
Merge pull request #102 from Liioooo/ivy-support
Browse files Browse the repository at this point in the history
support ivy renderer #101
  • Loading branch information
dockleryxk authored Mar 3, 2020
2 parents 663ba9e + 87aa530 commit dcf795c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/modules/slideshow/slideshow.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, ElementRef, EventEmitter, Inject, Input, Output, PLATFORM_ID, Renderer2, ViewChild, DoCheck, NgZone, OnInit, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef, OnChanges, SimpleChanges } from '@angular/core';
import { Component, ElementRef, EventEmitter, Inject, Input, Output, PLATFORM_ID, Renderer2, ViewChild, DoCheck, NgZone, OnInit, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef, OnChanges, SimpleChanges, AfterViewInit } from '@angular/core';
// import { SwipeService } from './swipe.service';
import { isPlatformServer, DOCUMENT } from '@angular/common';
import { ISlide } from './ISlide';
Expand All @@ -16,7 +16,7 @@ const FIRST_SLIDE_KEY = makeStateKey<any>('firstSlide');
providers: [PointerService],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class SlideshowComponent implements OnInit, DoCheck, OnChanges, OnDestroy {
export class SlideshowComponent implements OnInit, AfterViewInit, DoCheck, OnChanges, OnDestroy {
slideIndex: number = -1;
slides: ISlide[] = [];
hideLeftArrow: boolean = false;
Expand Down Expand Up @@ -86,7 +86,6 @@ export class SlideshowComponent implements OnInit, DoCheck, OnChanges, OnDestroy
if (this.debug !== undefined) {
console.warn('[Deprecation Warning]: The debug input will be removed from ng-simple-slideshow in 1.3.0');
}
this._pointerService.bind(this.container);
this._slideSub = this._pointerService.slideEvent.subscribe((indexDirection: number) => {
this.onSlide(indexDirection, true);
});
Expand All @@ -98,6 +97,10 @@ export class SlideshowComponent implements OnInit, DoCheck, OnChanges, OnDestroy
}
}

ngAfterViewInit(): void {
this._pointerService.bind(this.container);
}

ngOnDestroy() {
try {
if (this._slideSub && !this._slideSub.closed) {
Expand Down

0 comments on commit dcf795c

Please sign in to comment.