diff --git a/README.md b/README.md
index ac1bce6..23f9e66 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,3 @@
-# SocketApp
+# Greenvironment Frontend
-This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.4.
-
-## Development server
-
-Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
-
-## Code scaffolding
-
-Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
-
-## Build
-
-Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
-
-## Running unit tests
-
-Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
-
-## Running end-to-end tests
-
-Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
-
-## Further help
-
-To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
+This is the greenvironment frontend repository
\ No newline at end of file
diff --git a/src/app/components/chat/chat.component.html b/src/app/components/chat/chat.component.html
index 30f7be2..a30d068 100644
--- a/src/app/components/chat/chat.component.html
+++ b/src/app/components/chat/chat.component.html
@@ -4,13 +4,13 @@
{{childChat.memberName}}
-
+
{{message.content}}
{{message.content}}
-
-
+
+
\ No newline at end of file
diff --git a/src/app/components/chat/chat.component.sass b/src/app/components/chat/chat.component.sass
index cd1c90d..5ae8d7e 100644
--- a/src/app/components/chat/chat.component.sass
+++ b/src/app/components/chat/chat.component.sass
@@ -80,4 +80,12 @@
padding: 0.125em
resize: none
#send
- @include gridPosition(1, 2, 2, 3)
\ No newline at end of file
+ @include gridPosition(1, 2, 2, 3)
+ button
+ background-color: $cFeedChooserBackground
+ color: $cFontWhite
+ border: none
+ border-radius: 0.5em
+ button:hover
+ background-color: lighten($cFeedChooserBackground, 10%)
+ cursor: pointer
\ No newline at end of file
diff --git a/src/app/components/chat/chat.component.ts b/src/app/components/chat/chat.component.ts
index 92b6c2a..2cc80d4 100644
--- a/src/app/components/chat/chat.component.ts
+++ b/src/app/components/chat/chat.component.ts
@@ -11,9 +11,7 @@ import { Chat } from 'src/app/models/chat';
})
export class ChatComponent implements OnInit {
- messages:Array = [new Chatmessage("Hallo", "01.01.",true), new Chatmessage("Hallo", "01.01.",true),
- new Chatmessage("Hallo", "01.01.",true), new Chatmessage("Hallo", "01.01.",true), new Chatmessage("Hallo", "01.01.",true),
- new Chatmessage("Hallo", "01.01.",true)]
+ messages:Array
@Output() goBackEvent = new EventEmitter();
@Input() childChat: Chat;
@@ -21,16 +19,29 @@ export class ChatComponent implements OnInit {
constructor(private chatService: ChatService) { }
ngOnInit() {
+ this.refresh()
}
goBack() {
this.goBackEvent.emit(true)
- this.chatService.getAllChats()
}
- sendMessage(pContent: string) {
- this.chatService.sendMessage(this.childChat.id, pContent)
- this.chatService.getMessages(this.childChat.id)
+ sendMessage(pElement) {
+ this.chatService.sendMessage(this.childChat.id, pElement.value)
+ .subscribe(response => {
+ console.log("Message sent")
+ pElement.value = ""
+ this.refresh()
+ })
+ }
+
+ refresh() {
+ this.chatService.getMessagesRaw(this.childChat.id)
+ .subscribe(response =>
+ {
+ console.log("Downloading messages ...")
+ this.messages = this.chatService.renderMessages(response.json())
+ })
}
}
diff --git a/src/app/components/chatlist/chatlist.component.html b/src/app/components/chatlist/chatlist.component.html
index 8186327..be19e38 100644
--- a/src/app/components/chatlist/chatlist.component.html
+++ b/src/app/components/chatlist/chatlist.component.html
@@ -4,10 +4,10 @@