mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-18 05:58:07 +01:00
feat(data): update data module, add new mock data (#1960)
This commit is contained in:
parent
773c14e74a
commit
47d232b606
53 changed files with 635 additions and 256 deletions
|
|
@ -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: 'Today’s 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue