Skip to content

Commit 45710b1

Browse files
FabianGosebrinkFabianGosebrink
authored andcommitted
do not emtpy list before receiving new food
1 parent c270931 commit 45710b1

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/AspNetCoreAngular2/wwwroot/app/components/food/foodcomponent.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ export class FoodComponent implements OnInit {
8484
this.getAllFood();
8585
});
8686

87-
this._signalRService.foodchanged.subscribe(() => {
88-
this.foodItems = [];
87+
this._signalRService.foodchanged.subscribe((data) => {
8988
this.getAllFood();
9089
});
9190
}

src/AspNetCoreAngular2/wwwroot/app/services/signalRService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class SignalRService {
4949

5050
private registerOnServerEvents(): void {
5151
this.proxy.on('FoodAdded', (data) => {
52-
this.foodchanged.emit('this could be data');
52+
this.foodchanged.emit(data);
5353
});
5454

5555
this.proxy.on('FoodDeleted', (data) => {

0 commit comments

Comments
 (0)