This repository has been archived on 2023-08-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
FoodLoop-Web/src/app/layouts/full-layout.component.ts

58 lines
1.4 KiB
TypeScript
Raw Normal View History

import { Component, OnInit } from '@angular/core';
2017-06-05 18:47:34 +01:00
import { ApiService } from '../providers/api-service';
import { Router } from '@angular/router';
@Component({
selector: 'app-dashboard',
2017-06-05 18:47:34 +01:00
templateUrl: './full-layout.component.html',
providers: [ApiService]
})
export class FullLayoutComponent implements OnInit {
customersThisMonth: any;
moneySpentThisMonth: any;
pointsTotal: any;
averageTransactionToday: any;
2017-06-05 18:47:34 +01:00
constructor(
private api: ApiService,
private router: Router,
) {
/* this.api.breadcrumb_data(undefined)
.subscribe(
result => {
console.log(result);
this.customersThisMonth = result.customersthismonth;
this.moneySpentThisMonth = result.moneyspentthismonth;
this.pointsTotal = result.pointstotal;
this.averageTransactionToday = result.averagetransactiontoday;
}
) */
}
public disabled = false;
public status: {isopen: boolean} = {isopen: false};
public toggled(open: boolean): void {
console.log('Dropdown is now: ', open);
}
public toggleDropdown($event: MouseEvent): void {
$event.preventDefault();
$event.stopPropagation();
this.status.isopen = !this.status.isopen;
}
ngOnInit(): void {}
2017-06-05 18:47:34 +01:00
userlogout() {
console.log('logout clicked');
this.api
.logout()
.subscribe(
result => {
console.log('Logged out!');
window.location.reload();
2017-06-05 18:47:34 +01:00
}
);
}
}