File
Metadata
selector |
cd-performance-counter |
styleUrls |
./performance-counter.component.scss |
templateUrl |
./performance-counter.component.html |
Static
defaultFromLink
|
Type : string
|
Default value : '/hosts'
|
|
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'cd-performance-counter',
templateUrl: './performance-counter.component.html',
styleUrls: ['./performance-counter.component.scss']
})
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 = params.id;
this.serviceType = params.type;
});
}
}
<legend>{{ serviceType }}.{{ serviceId }}</legend>
<cd-table-performance-counter [serviceType]="serviceType"
[serviceId]="serviceId">
</cd-table-performance-counter>
Legend
Html element with directive