From 69a5260b365df8b73cbe27da53c74200046e99d0 Mon Sep 17 00:00:00 2001 From: Hagen <hagen.dressler@mni.thm.de> Date: Thu, 8 Mar 2018 15:04:00 +0100 Subject: [PATCH] Add notification to component comment --- src/app/comment/comment.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/comment/comment.component.ts b/src/app/comment/comment.component.ts index 2094d8ab2..f8ab68b39 100644 --- a/src/app/comment/comment.component.ts +++ b/src/app/comment/comment.component.ts @@ -4,6 +4,7 @@ import { Location } from '@angular/common'; import { Comment } from '../comment'; import { CommentService} from '../comment.service'; import { RoomService } from '../room.service'; +import { NotificationService } from '../notification.service'; @Component({ selector: 'app-comment', @@ -17,7 +18,8 @@ export class CommentComponent implements OnInit { private route: ActivatedRoute, private roomService: RoomService, private location: Location, - private commentService: CommentService) { } + private commentService: CommentService, + private notification: NotificationService) { } ngOnInit() { this.route.params.subscribe(params => { @@ -28,14 +30,15 @@ export class CommentComponent implements OnInit { getRoom(id: string): void { this.roomService.getRoom(id).subscribe( params => { - this.getComments(params['id']); + this.getComments(params['id'], params['name']); } ); } - getComments(roomId: string): void { + getComments(roomId: string, roomName: string): void { this.commentService.getComments(roomId) .subscribe(comments => this.comments = comments); + this.notification.show(`All comments of room "${roomName}" loaded!`); } goBack(): void { -- GitLab