This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
FoodLoop-Web/src/app/snippets/org-snippet-bar.component.ts

31 lines
909 B
TypeScript
Raw Normal View History

import { Component, OnInit } from '@angular/core';
import { OrgSnippetsService } from '../providers/org-snippets.service';
@Component({
selector: 'snippet-bar-org',
templateUrl: 'org-snippet-bar.component.html',
})
export class OrgBarSnippetComponent implements OnInit {
2017-09-07 14:36:19 +00:00
public customersThisMonth = 0;
public moneySpentThisMonth = 0;
public pointsTotal = 0;
public averageTransactionToday = 0;
constructor(
private snippetsService: OrgSnippetsService,
) { }
public ngOnInit(): void {
this.snippetsService.getData()
.subscribe(
result => {
2017-09-07 14:36:19 +00:00
this.customersThisMonth = result.snippets.this_month_customer_count;
this.moneySpentThisMonth = result.snippets.this_month_customer_spend;
this.pointsTotal = result.snippets.pear_points_total;
this.averageTransactionToday = result.snippets.today_sales_average;
}
);
}
}