Skip to content
Snippets Groups Projects
Commit ea9db993 authored by Hagen Dreßler's avatar Hagen Dreßler
Browse files

Add navigate to component create-comment

parent 9e556bd0
No related merge requests found
......@@ -6,6 +6,7 @@ import { Comment } from '../comment';
import { RoomService } from '../room.service';
import { CommentService} from '../comment.service';
import { NotificationService } from '../notification.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-create-comment',
......@@ -16,6 +17,7 @@ export class CreateCommentComponent implements OnInit {
@Input() room: Room;
constructor(
private router: Router,
private route: ActivatedRoute,
private roomService: RoomService,
private commentService: CommentService,
......@@ -44,6 +46,7 @@ export class CreateCommentComponent implements OnInit {
body: body,
creationTimestamp: new Date(Date.now())
} as Comment).subscribe(room => {
this.router.navigate([`room/${this.room.id}`]);
this.notification.show(`Comment '${subject}' successfully created.`);
});
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment