]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
25fa82e4e9d14798314d704cef153fea8a9eb6d6
[ceph.git] /
1 import { Component, OnDestroy } 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 OnDestroy {
10   serviceId: string;
11   serviceType: string;
12   routeParamsSubscribe: any;
13
14   constructor(private route: ActivatedRoute) {
15     this.routeParamsSubscribe = this.route.params.subscribe(
16       (params: { type: string; id: string }) => {
17         this.serviceId = params.id;
18         this.serviceType = params.type;
19       }
20     );
21   }
22
23   ngOnDestroy() {
24     this.routeParamsSubscribe.unsubscribe();
25   }
26 }