mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-09-22 05:50:48 +02:00

With this change all components, which used data services before, now use abstract classes of service interfaces, mock services extend interface services, CoreModule contains code to inject a needed implementation of some service.
23 lines
734 B
TypeScript
23 lines
734 B
TypeScript
import { Component } from '@angular/core';
|
|
import { ProfitBarAnimationChartData } from '../../../../@core/data/profit-bar-animation-chart';
|
|
import { takeWhile } from 'rxjs/operators';
|
|
|
|
@Component({
|
|
selector: 'ngx-stats-card-front',
|
|
styleUrls: ['./stats-card-front.component.scss'],
|
|
templateUrl: './stats-card-front.component.html',
|
|
})
|
|
export class StatsCardFrontComponent {
|
|
|
|
private alive = true;
|
|
|
|
linesData: { firstLine: number[]; secondLine: number[] };
|
|
|
|
constructor(private profitBarAnimationChartService: ProfitBarAnimationChartData) {
|
|
this.profitBarAnimationChartService.getChartData()
|
|
.pipe(takeWhile(() => this.alive))
|
|
.subscribe((linesData) => {
|
|
this.linesData = linesData;
|
|
});
|
|
}
|
|
}
|