All files / src/app/components/signals signals.component.ts

100% Statements 9/9
100% Branches 2/2
100% Functions 3/3
100% Lines 8/8

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 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                            136x 11x 11x   11x         11x 11x   11x 125x    
import { ChangeDetectorRef, Component, OnInit, ViewChild, inject } from '@angular/core';
 
 
import { TableModule } from 'primeng/table';
import { ButtonModule } from 'primeng/button';
import { TagModule } from 'primeng/tag';
 
import { TwinpadApiService } from '../../services/twinpad-api.service';
import { SignalStats } from '../../models/signals';
 
import { SignalsTableComponent } from '../signals-table/signals-table.component';
import { HttpErrorResponse } from '@angular/common/http';
import { ErrorComponent } from '../error/error.component';
import { NumberSuffixPipe } from '../../pipes/number-suffix.pipe';
 
@Component({
    selector: 'app-signals',
    imports: [ErrorComponent, NumberSuffixPipe, TableModule, ButtonModule, TagModule, SignalsTableComponent],
    providers: [],
    templateUrl: './signals.component.html',
    styleUrl: './signals.component.scss'
})
export class SignalsComponent implements OnInit {
  private twinpadApiService = inject(TwinpadApiService);
  private cdr = inject(ChangeDetectorRef);
 
  @ViewChild(SignalsTableComponent) signalsTableComponent!: SignalsTableComponent;
  signalStats: SignalStats;
  signalsError: HttpErrorResponse;
 
  ngOnInit() {
    this.twinpadApiService.getSignalStats().subscribe((data: SignalStats) => {
      this.signalStats = data;
    });
    this.cdr.detectChanges();
  }
}