Skip to content

Commit

Permalink
Edge case for no boked cuisines solved
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraagrijal3138 committed Apr 17, 2018
1 parent b22e0c9 commit 8285963
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/app/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ <h1>
</h1>
<mat-tab-group>
<mat-tab label="Hosted Cuisines">
<p>
These are the cuisines you posted!
</p>
<p>Below are your Hosted Cuisines.</p>
<app-hostcuisines></app-hostcuisines>
</mat-tab>
<mat-tab label="Booked Cuisines">
<p *ngIf="isEmpty">Oops looks like you dont have booked cuisines.You can book cuisines from
<a routerLink="/cuisines">here.</a>
</p>
<mat-expansion-panel *ngFor="let book of (booked | async)">
<mat-expansion-panel-header>
<mat-panel-title>
Expand Down
15 changes: 9 additions & 6 deletions src/app/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class DashboardComponent implements OnInit {
userName: String;
notifications : Observable<any[]>;
booked: Observable<any[]>;
isEmpty:boolean = true;
constructor(private authService: AuthService,
private router: Router,
private cuisinesService: CuisinesService) {
Expand All @@ -24,11 +25,13 @@ export class DashboardComponent implements OnInit {
ngOnInit() {
this.notifications = this.cuisinesService.notification;
this.booked = this.cuisinesService.bookedCuisines;
// this.cuisinesService.notification
// .subscribe(
// (message : any) => {
// console.log(message);
// }
// );
this.cuisinesService.bookedCuisines
.subscribe(
(message : any) => {
if(message.length > 0){
this.isEmpty = false;
}
}
);
}
}

0 comments on commit 8285963

Please sign in to comment.