feat(data): update data module, add new mock data (#1960)

This commit is contained in:
Denis Strigo 2019-01-08 16:17:20 +03:00 committed by GitHub
parent 773c14e74a
commit 47d232b606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 635 additions and 256 deletions

View file

@ -1,29 +1,27 @@
import {Component} from '@angular/core';
import { Component, OnDestroy } from '@angular/core';
import { ProgressInfo, StatsProgressBarService } from '../../../@core/data/stats-progress-bar.service';
import { takeWhile } from 'rxjs/operators';
@Component({
selector: 'ngx-progress-section',
styleUrls: ['./progress-section.component.scss'],
templateUrl: './progress-section.component.html',
})
export class ECommerceProgressSectionComponent {
progressInfoData = [
{
title: 'Todays Profit',
value: 572900,
activeProgress: 70,
description: 'Better than last week (70%)',
},
{
title: 'New Orders',
value: 6378,
activeProgress: 30,
description: 'Better than last week (30%)',
},
{
title: 'New Comments',
value: 200,
activeProgress: 55,
description: 'Better than last week (55%)',
},
];
export class ECommerceProgressSectionComponent implements OnDestroy {
private alive = true;
progressInfoData: ProgressInfo[];
constructor(private statsProgressBarService: StatsProgressBarService) {
this.statsProgressBarService.getProgressInfoData()
.pipe(takeWhile(() => this.alive))
.subscribe((data) => {
this.progressInfoData = data;
});
}
ngOnDestroy() {
this.alive = true;
}
}