1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
export class ChatThreadComponent implements OnInit{
@Input() thread: Thread;
selected = false;
currentThread: Thread;
currentBox: Box;
constructor(public threadsService: ThreadsService,
public boxService: BoxService) {
}
ngOnInit(): void {
this.threadsService.currentThread
.subscribe((currentThread: Thread) => {
this.selected = currentThread &&
this.thread &&
(currentThread.id === this.thread.id);
});
}
clicked(id?: string, thread?: Thread): void {
this.boxService.addChatWindow(id, thread);
this.threadsService.setCurrentThread(thread);
}
} |
Partager