Skip to content
This repository has been archived by the owner on Aug 3, 2018. It is now read-only.

Commit

Permalink
fix(meditation-chart): fix access to undefined attribute via init prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin committed Sep 23, 2016
1 parent 2f2429f commit d8e0b0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"hammerjs": "^2.0.8",
"ie-shim": "^0.1.0",
"jstimezonedetect": "^1.0.6",
"ng2-charts": "^1.2.0",
"ng2-charts": "^1.3.0",
"normalize.css": "^4.1.1",
"rxjs": "5.0.0-beta.12",
"scriptjs": "^2.5.8",
Expand Down
4 changes: 3 additions & 1 deletion src/app/meditation/chart/meditation-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export class MeditationChartComponent {
// chart details
chartSubscribtion: Subscription;
chartLastHour: string = '';
chartData: Array<any> = [{data: [], label: ''}, {data: [], label: ''}];
initChart: boolean = false;
chartData: Array<any> = [];
chartLabels: String[] = [];
chartColors: Array<any> = [];
chartOptions = {
Expand Down Expand Up @@ -104,6 +105,7 @@ export class MeditationChartComponent {
}
this.chartData = [data, dataCurrentHour];
this.chartColors = colors;
this.initChart = true;
}, () => this.loading = false);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/meditation/chart/meditation-chart.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="chart-wrapper">
<div class="chart-wrapper" *ngIf="initChart">
<base-chart
class="chart"
[datasets]="chartData"
Expand Down

0 comments on commit d8e0b0e

Please sign in to comment.