All files / lib/components/global-progress-bar global-progress-bar.component.ts

100% Statements 3/3
100% Branches 2/2
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                    4x       5x 4x        
import { AfterViewInit, ChangeDetectionStrategy, Component, ViewChild } from '@angular/core';
import { MatProgressBar } from '@angular/material/progress-bar';
 
@Component({
  selector: 'app-global-progress-bar',
  templateUrl: './global-progress-bar.component.html',
  styleUrls: ['./global-progress-bar.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
  standalone: false,
})
export class AppGlobalProgressBarComponent implements AfterViewInit {
  @ViewChild(MatProgressBar) public progressBar?: MatProgressBar;
 
  public ngAfterViewInit() {
    if (typeof this.progressBar !== 'undefined') {
      this.progressBar._elementRef.nativeElement.style.width = `${document.body.clientWidth}px`;
    }
  }
}