diff --git a/src/plugin/affix.directive.ts b/src/plugin/affix.directive.ts index 7bc8221..217a242 100644 --- a/src/plugin/affix.directive.ts +++ b/src/plugin/affix.directive.ts @@ -25,8 +25,14 @@ export interface ScrollSpyAffixOptions { } }) export class ScrollSpyAffixDirective implements AfterViewInit, OnDestroy { - @Input('scrollSpyAffix') options: ScrollSpyAffixOptions; + @Input('scrollSpyAffix') public options: ScrollSpyAffixOptions; + public elementTop: number; + public elementBottom: number; + public affix: boolean = false; + public affixTop: boolean = false; + public affixBottom: boolean = false; + private defaultOptions: ScrollSpyAffixOptions = { topMargin: 0, bottomMargin: 0 @@ -37,12 +43,6 @@ export class ScrollSpyAffixDirective implements AfterViewInit, OnDestroy { private el: HTMLElement; private parentEl: any; - private elementTop: number; - private elementBottom: number; - private affix: boolean = false; - private affixTop: boolean = false; - private affixBottom: boolean = false; - constructor( private ref: ChangeDetectorRef, private elRef: ElementRef, diff --git a/src/plugin/index.component.ts b/src/plugin/index.component.ts index 5ee5abd..e70b333 100644 --- a/src/plugin/index.component.ts +++ b/src/plugin/index.component.ts @@ -32,8 +32,15 @@ export interface ScrollSpyIndexComponentOptions { changeDetection: ChangeDetectionStrategy.OnPush }) export class ScrollSpyIndexRenderComponent implements OnInit, AfterViewInit, OnDestroy { - @Input() scrollSpyIndexRenderOptions: ScrollSpyIndexComponentOptions; + @Input() public scrollSpyIndexRenderOptions: ScrollSpyIndexComponentOptions; + public stack: Array = []; + public parentStack: Array = []; + public lastItem: any; + + public currentScrollPosition: number; + public itemsToHighlight: Array = []; + @ViewChild('container', { read: ViewContainerRef }) private viewContainerRef: ViewContainerRef; @@ -47,13 +54,6 @@ export class ScrollSpyIndexRenderComponent implements OnInit, AfterViewInit, OnD private el: HTMLElement; - private stack: Array = []; - private parentStack: Array = []; - private lastItem: any; - - private currentScrollPosition: number; - private itemsToHighlight: Array = []; - constructor( private compiler: Compiler, private ref: ChangeDetectorRef, diff --git a/src/plugin/index.directive.ts b/src/plugin/index.directive.ts index b60e926..9418d00 100644 --- a/src/plugin/index.directive.ts +++ b/src/plugin/index.directive.ts @@ -20,7 +20,7 @@ export interface ScrollSpyIndexOptions { selector: '[scrollSpyIndex]' }) export class ScrollSpyIndexDirective implements OnInit, AfterViewInit, OnDestroy { - @Input('scrollSpyIndex') options: ScrollSpyIndexOptions; + @Input('scrollSpyIndex') public options: ScrollSpyIndexOptions; private defaultOptions: ScrollSpyIndexOptions = { selector: 'anchor' diff --git a/src/plugin/infinite.directive.ts b/src/plugin/infinite.directive.ts index 39ada22..4b5250d 100644 --- a/src/plugin/infinite.directive.ts +++ b/src/plugin/infinite.directive.ts @@ -21,10 +21,10 @@ export interface ScrollSpyInfiniteOptions { selector: '[scrollSpyInfinite]' }) export class ScrollSpyInfiniteDirective implements OnInit, AfterViewInit, OnDestroy { - @Input('scrollSpyInfinite') options: ScrollSpyInfiniteOptions; - @Input() scrollSpyInfiniteDisabled: boolean; + @Input('scrollSpyInfinite') public options: ScrollSpyInfiniteOptions; + @Input() public scrollSpyInfiniteDisabled: boolean; - @Output() scrollSpyInfiniteEvent: EventEmitter = new EventEmitter(); + @Output() public scrollSpyInfiniteEvent: EventEmitter = new EventEmitter(); private defaultOptions: ScrollSpyInfiniteOptions = { spyId: 'window', diff --git a/src/plugin/parallax.directive.ts b/src/plugin/parallax.directive.ts index baefcee..1120f55 100644 --- a/src/plugin/parallax.directive.ts +++ b/src/plugin/parallax.directive.ts @@ -51,9 +51,12 @@ export interface ScrollSpyParallaxOptions { selector: '[scrollSpyParallax]' }) export class ScrollSpyParallaxDirective implements OnInit, AfterViewInit, OnDestroy { - @Input('scrollSpyParallax') options: ScrollSpyParallaxOptions; - @Input() scrollSpyParallaxDisabled: boolean; + @Input('scrollSpyParallax') public options: ScrollSpyParallaxOptions; + @Input() public scrollSpyParallaxDisabled: boolean; + public cssValue: string; + public isSpecialVal: boolean = false; + private defaultOptions: ScrollSpyParallaxOptions = { spyId: 'window', horizontal: false, @@ -69,9 +72,6 @@ export class ScrollSpyParallaxDirective implements OnInit, AfterViewInit, OnDest private el: HTMLElement; - private cssValue: string; - private isSpecialVal: boolean = false; - constructor( private renderer: Renderer, private elRef: ElementRef,