import { Component, Inject, Input, OnInit } from '@angular/core'; import { colorsEnum, Colors } from '../../../shared/enums'; @Component({ selector: 'cmn-nav-bar', templateUrl: './nav-bar.component.html', styleUrls: [ './nav-bar.component.scss' ], }) export class NavBarComponent implements OnInit { @Input() public readonly isFixed: boolean; @Input() public readonly hasContainer: boolean; @Input() public readonly color: Colors = colorsEnum.light; constructor(@Inject('Document') private readonly document) {} public ngOnInit(): void { if (this.isFixed) { const htmlElement = this.document.querySelector('html'); htmlElement.classList.add('has-navbar-fixed-top'); } } }