1
|
import {Component, OnInit, ViewChild} from '@angular/core';
|
2
|
import {ConfirmationDialogComponent} from '../../shared/confirmation-dialog.component';
|
3
|
|
4
|
@Component ({
|
5
|
selector: 'metrics-enable',
|
6
|
templateUrl: 'metrics-enable.component.html'
|
7
|
})
|
8
|
|
9
|
export class MetricsEnableComponent implements OnInit {
|
10
|
someid: string;
|
11
|
modalTitle = "Confirmation";
|
12
|
modalButton = "Yes, enable it";
|
13
|
isModalShown: boolean;
|
14
|
|
15
|
@ViewChild('confirmEnablingModal')
|
16
|
public confirmEnablingModal : ConfirmationDialogComponent;
|
17
|
|
18
|
|
19
|
constructor() {}
|
20
|
|
21
|
ngOnInit() {
|
22
|
this.someid = 'someid';
|
23
|
this.isModalShown = false;
|
24
|
}
|
25
|
|
26
|
confirmEnabling() {
|
27
|
this.confirmEnablingModal.ids = [this.someid];
|
28
|
this.confirmEnablingModal.showModal();
|
29
|
}
|
30
|
|
31
|
confirmedEnabling(ids: string[]){
|
32
|
const id = ids[0];
|
33
|
console.log('received ' + id);
|
34
|
}
|
35
|
}
|