Add class to body and intercept DOM using Renderer2 in Angular

import { Component, OnDestroy, Renderer2 } from '@angular/core';

export class myModalComponent implements OnDestroy {

  constructor(private renderer: Renderer2) {
    this.renderer.addClass(document.body, 'modal-open');
   }

  ngOnDestroy() {
    this.renderer.removeClass(document.body, 'modal-open');
  }

References
https://stackoverflow.com/questions/43542373/angular2-add-class-to-body-tag
https://angular.io/api/core/Renderer2