Skip to content
Snippets Groups Projects
app.component.ts 1.21 KiB
Newer Older
  • Learn to ignore specific revisions
  • Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    import { Component } from '@angular/core';
    
    import { ProfileService } from './profile/services/profile.service';
    import { AuthService } from './services/auth.service';
    
    import { RouterListenerService } from './services/routerListener.service';
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    import { PrintService } from './shared/service/print.service';
    
    import { WindowScrollService } from './shared/service/windowscroll.service';
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      styleUrls: ['./app.component.scss'],
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    })
    export class AppComponent {
      title = 'pamn';
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    
    
      constructor(
        public printService: PrintService,
        private authService: AuthService,
    
        private profilService: ProfileService,
    
        private routerListenerService: RouterListenerService,
        private windowScrollService: WindowScrollService
    
      ) {
        if (this.authService.isLoggedIn()) {
          this.profilService.getProfile();
        }
    
        this.setHeightApp();
        window.addEventListener('resize', () => {
          this.setHeightApp();
        });
      }
    
      private setHeightApp(): void {
        const vh = window.innerHeight * 0.01;
        document.documentElement.style.setProperty('--vh', `${vh}px`);
    
      public onScrollDown(event): void {
        this.windowScrollService.scrollY.next(event);
      }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    }