Fixed Chatlist

master
lampe_n1 5 years ago
parent b6b6c0fc10
commit 752bc496d2

@ -4,7 +4,7 @@
<button id="newchat" (click)="newChat()"><span><i class="fa fa-plus fa-3x" aria-hidden="true"></i></span></button> <button id="newchat" (click)="newChat()"><span><i class="fa fa-plus fa-3x" aria-hidden="true"></i></span></button>
</div> </div>
<div id="chats"> <div id="chats">
<div class="chatitem" *ngFor="let chat of chatService.chats" <div class="chatitem" *ngFor="let chat of chats"
[class.selected]="chat === selectedChat" (click)="showChat(chat)"> [class.selected]="chat === selectedChat" (click)="showChat(chat)">
<div class="picture">Pic</div> <div class="picture">Pic</div>
<div class="name"><span>{{chat.id}}</span></div> <div class="name"><span>{{chat.id}}</span></div>

@ -1,7 +1,7 @@
import { Component, OnInit, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { Chatinfo } from 'src/app/models/chatinfo'; import { Chatinfo } from 'src/app/models/chatinfo';
import { ChatService } from 'src/app/services/chat/chat.service';
import { Chat } from 'src/app/models/chat'; import { Chat } from 'src/app/models/chat';
import { ChatService } from 'src/app/services/chat/chat.service';
@Component({ @Component({
selector: 'chatmanager-chatlist', selector: 'chatmanager-chatlist',
@ -13,11 +13,12 @@ export class ChatlistComponent implements OnInit {
@Output() showChatEvent = new EventEmitter<Chat>(); @Output() showChatEvent = new EventEmitter<Chat>();
@Output() showCreateChatEvent = new EventEmitter<boolean>(); @Output() showCreateChatEvent = new EventEmitter<boolean>();
selectedChat: Chat; selectedChat: Chat;
chats: Array<Chat>
constructor(private chatService: ChatService) { } constructor(private chatService: ChatService) { }
ngOnInit() { ngOnInit() {
this.chats = this.chatService.chats
} }
showNewChat() { showNewChat() {

Loading…
Cancel
Save