]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
60549afa800a68a8b03cd89960b57b6010eebd54
[ceph.git] /
1 import { Component, OnDestroy, OnInit } from '@angular/core';
2 import { ActivatedRoute } from '@angular/router';
3
4 @Component({
5   selector: 'cd-performance-counter',
6   templateUrl: './performance-counter.component.html',
7   styleUrls: ['./performance-counter.component.scss']
8 })
9 export class PerformanceCounterComponent implements OnInit, OnDestroy {
10   serviceId: string;
11   serviceType: string;
12   routeParamsSubscribe: any;
13
14   constructor(private route: ActivatedRoute) { }
15
16   ngOnInit() {
17     this.routeParamsSubscribe = this.route.params.subscribe(
18       (params: { type: string; id: string }) => {
19         this.serviceId = params.id;
20         this.serviceType = params.type;
21       }
22     );
23   }
24
25   ngOnDestroy() {
26     this.routeParamsSubscribe.unsubscribe();
27   }
28 }