multi-project/projects/app/_modules/viget/slider/slider.component.ts

39 lines
869 B
TypeScript

import { AfterViewInit, Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { WindowScrollingService } from '@app/_services/window-scrolling.service';
@Component({
selector: 'slider',
templateUrl: './slider.component.html',
styleUrls: ['./slider.component.scss']
})
export class SliderComponent implements OnInit {
@Input() width: 'string';
@Input() side: 'left'|'right' ='right';
css:any;
constructor(
private windowScrollingService: WindowScrollingService,
private router:Router
){}
ngOnInit(){
this.windowScrollingService.disable();
this.css = {
'left-side': this.side=='left',
'right-side': this.side=='right'
}
}
ngOnDestroy(){
this.windowScrollingService.enable();
}
close() {
this.router.navigate([{outlets: {slider: null}}]).then();
}
}