ngx-admin/src/app/pages/e-commerce/profit-card/front-side/stats-card-front.component.ts
Valentin Kononov cac36f0717 refactor(@core): refactor data services for better integration (#1997)
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.
2019-01-18 16:25:35 +03:00

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;
});
}
}