This repository was archived by the owner on May 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 27
27
< select #counterName ="ngModel " name ="counterName_{{item.id}} " [(ngModel)] ="item.counter "
28
28
[compareWith] ="compareCounter " required (ngModelChange) ="onCounterNameChange(item) ">
29
29
< option [ngValue] ="undefined " disabled ="disabled "> Please select a counter...</ option >
30
- < option *ngFor ="let counter of counters "
30
+ < option *ngFor ="let counter of item. counters "
31
31
[ngValue] ="counter "> {{counter.name}}</ option >
32
32
</ select >
33
33
< span class ="help-block " *ngIf ="counterName.invalid && counterName.touched "> Please select a counter.</ span >
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import { Counter } from './../model/counter.model';
18
18
export class DashboardComponent implements OnInit {
19
19
20
20
busy : Subscription ;
21
- public counters : Counter [ ] = [ ] ;
22
21
23
22
public get dashboardItems ( ) {
24
23
return this . analyticsService . dashboardItems ;
@@ -78,10 +77,11 @@ export class DashboardComponent implements OnInit {
78
77
* Retrieves metrics for specific type.
79
78
* @param {MetricType } metricType to retrieve.
80
79
*/
81
- onMetricTypeChange ( metricType : MetricType ) {
80
+ onMetricTypeChange ( metricType : MetricType , dashBoardItem : DashboardItem ) {
82
81
console . log ( 'Selected Metric Type:' , metricType ) ;
82
+ dashBoardItem . counters = [ ] ;
83
83
this . analyticsService . getStreamsForMetricType ( metricType ) . subscribe ( result => {
84
- this . counters = result . items ;
84
+ dashBoardItem . counters = result . items ;
85
85
} ) ;
86
86
}
87
87
Original file line number Diff line number Diff line change 1
1
import { Serializable } from '../../shared/model' ;
2
2
import { MetricType } from './metric-type.model' ;
3
3
import { Counter } from './counter.model' ;
4
+ import { Page } from '../../shared/model' ;
4
5
import { Subscription } from 'rxjs/Subscription' ;
5
6
6
7
/**
@@ -20,6 +21,8 @@ export class DashboardItem implements Serializable<DashboardItem> {
20
21
public chartHeight = 140 ;
21
22
public barSize = 2 ;
22
23
24
+ public counters : Counter [ ] = [ ] ;
25
+
23
26
constructor (
24
27
) { }
25
28
You can’t perform that action at this time.
0 commit comments