File

src/app/modules/core/directives/bodyscroll.directive.ts

Implements

AfterViewInit OnDestroy

Metadata

Index

Methods

Methods

ngAfterViewInit
ngAfterViewInit()
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
import {Directive, AfterViewInit, OnDestroy} from '@angular/core';

@Directive({
  selector: '[appBodyScroll]'
})
export class BodyScrollDirective implements AfterViewInit, OnDestroy {

  ngAfterViewInit(): void {
    document.getElementsByTagName('body')[0].classList.add('o-y-hide');
  }
  ngOnDestroy(): void {
    document.getElementsByTagName('body')[0].classList.remove('o-y-hide');
  }

}

results matching ""

    No results matching ""