Changeset ad60966 for Farmatiko/ClientApp/src/app/dashboard
- Timestamp:
- 11/05/20 08:53:48 (4 years ago)
- Branches:
- master
- Children:
- 1db5673
- Parents:
- afc9a9a
- Location:
- Farmatiko/ClientApp/src/app/dashboard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.html
rafc9a9a rad60966 12 12 <div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse"> 13 13 <ul class="navbar-nav flex-grow"> 14 <li>Logged as ...<p *ngIf="head">{{head.Name}}</p> </li> 14 <li>Logged as <p *ngIf="head">{{head.Name}}</p> </li> 15 <li (click)="logout()" class="btn btn-link"><a>Logout</a></li> 15 16 </ul> 16 17 </div> -
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts
rafc9a9a rad60966 3 3 import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar'; 4 4 import { IPharmacy, IMedicine, IPharmacyHead, IPharmacyHeadRequest } from '../shared/interfaces'; 5 import { DataService } from '../shared/ services/data.service';5 import { DataService } from '../shared/data.service'; 6 6 import { PharmacyDialogComponent } from '../dialogs/pharmacy-dialog/pharmacy-dialog.component'; 7 7 import { EditPharmacyDialogComponent } from '../dialogs/edit-pharmacy-dialog/edit-pharmacy-dialog.component'; … … 27 27 28 28 ngOnInit(): void { 29 this.authService.getUser().subscribe((data : IPharmacyHead) => { 30 this.head = data; 31 }); 29 this.authService.getUser() 30 .subscribe((data) => { 31 console.log(data); 32 this.head = data; 33 }, 34 (err: any) => console.log(err), 35 () => console.log('User data retrieved')); 32 36 this.dataService.getPharmacies() 33 37 .subscribe((pharmacy: IPharmacy[]) => { … … 102 106 } 103 107 108 logout() { 109 this.authService.logout(); 110 } 111 104 112 openPharmacyDialog(pharmacy: IPharmacy): void { 105 113 this.dialog.open(PharmacyDialogComponent, {
Note:
See TracChangeset
for help on using the changeset viewer.