Synchronously get the status of each folder

This commit is contained in:
Jesse Lucas
2020-03-29 16:51:12 -04:00
parent dae0872379
commit 063951cffa
3 changed files with 35 additions and 11 deletions
@@ -1,6 +1,5 @@
import { Component, Input } from '@angular/core';
import { Chart } from 'chart.js'
import { SystemConfigService } from 'src/app/system-config.service';
@Component({
selector: 'app-donut-chart',
@@ -32,7 +31,6 @@ export class DonutChartComponent {
this.chart.update();
}
ngAfterViewInit(): void {
this.canvas = document.getElementById(this.elementID);
this.ctx = this.canvas.getContext('2d');
@@ -14,9 +14,9 @@ import { DonutChartComponent } from '../donut-chart/donut-chart.component';
})
export class FolderChartComponent implements OnInit {
@ViewChild(DonutChartComponent) donutChart: DonutChartComponent;
chartID: string = 'foldersChart';
elevation: string = cardElevation;
constructor(
private systemConfigService: SystemConfigService,
private folderService: FolderService,
@@ -30,9 +30,9 @@ export class FolderChartComponent implements OnInit {
// TODO: Find total number of folders
this.folderService.getAll().subscribe(
folder => {
// TODO: Clear existing data
this.donutChart.data([0, 30, 32, 40]);
this.donutChart.data([40]);
console.log("folder?", folder)
}
);