All files / src/app/ceph/performance-counter/performance-counter performance-counter.component.ts

100% Statements 15/15
83.33% Branches 5/6
100% Functions 4/4
100% Lines 11/11

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 2610x 10x             10x 10x           1x 1x 1x   1x 1x 1x     10x  
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
 
@Component({
  selector: 'cd-performance-counter',
  template: require('./performance-counter.component.html'),
  styles: []
})
export class PerformanceCounterComponent {
  static defaultFromLink = '/hosts';
 
  serviceId: string;
  serviceType: string;
  fromLink: string;
 
  constructor(private route: ActivatedRoute) {
    this.route.queryParams.subscribe((params: { fromLink: string }) => {
      this.fromLink = params.fromLink || PerformanceCounterComponent.defaultFromLink;
    });
    this.route.params.subscribe((params: { type: string; id: string }) => {
      this.serviceId = decodeURIComponent(params.id);
      this.serviceType = params.type;
    });
  }
}