From 2213b9a0f5d21b153e076c36db5f8b60b53de1f5 Mon Sep 17 00:00:00 2001 From: Hagen <hagen.dressler@mni.thm.de> Date: Thu, 8 Mar 2018 01:03:10 +0100 Subject: [PATCH] Fix missing imports --- src/app/comment.service.ts | 2 ++ src/app/create-comment/create-comment.component.ts | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/comment.service.ts b/src/app/comment.service.ts index 635c2edda..44b1b7c9f 100644 --- a/src/app/comment.service.ts +++ b/src/app/comment.service.ts @@ -3,6 +3,8 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; +import { Comment } from './comment'; + const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) diff --git a/src/app/create-comment/create-comment.component.ts b/src/app/create-comment/create-comment.component.ts index 337ec0218..14b97eb5c 100644 --- a/src/app/create-comment/create-comment.component.ts +++ b/src/app/create-comment/create-comment.component.ts @@ -3,6 +3,7 @@ import { ActivatedRoute } from '@angular/router'; import { Location } from '@angular/common'; import { Room } from '../room'; +import { Comment } from '../comment'; import { RoomService } from '../room.service'; import { CommentService} from '../comment.service'; @@ -34,9 +35,15 @@ export class CreateCommentComponent implements OnInit { send(subject: string, body: string): void { subject = subject.trim(); body = body.trim(); - if (!subject || !body) { return; } - this.commentService.addComment( { roomId: this.room.id, subject: subject, - body: body, creationTimestamp: Date.now() } as Comment ).subscribe(); + if (!subject || !body) { + return; + } + this.commentService.addComment({ + roomId: this.room.id, + subject: subject, + body: body, + creationTimestamp: Date.now() + } as Comment).subscribe(); } goBack(): void { -- GitLab