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

100% Statements 8/8
100% Branches 2/2
100% Functions 4/4
100% Lines 6/6

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                                              43x 8x       8x     8x 7x   8x      
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { NgIf} from '@angular/common';
 
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, NgIf, NumberSuffixPipe,
        TableModule, ButtonModule, TagModule, SignalsTableComponent],
    providers: [TwinpadApiService],
    templateUrl: './signals.component.html',
    styleUrl: './signals.component.css'
})
export class SignalsComponent implements OnInit {
  @ViewChild(SignalsTableComponent) signalsTableComponent!: SignalsTableComponent;
  signalStats: SignalStats;
  signalsError: HttpErrorResponse;
 
  constructor(private twinpadApiService: TwinpadApiService, private cdr: ChangeDetectorRef) {}
 
  ngOnInit() {
    this.twinpadApiService.getSignalStats().subscribe((data: SignalStats) => {
      this.signalStats = data;
    });
    this.cdr.detectChanges();
  }
}