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>
</div>
<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)">
<div class="picture">Pic</div>
<div class="name"><span>{{chat.id}}</span></div>

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

Loading…
Cancel
Save