mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-07-01 06:06:22 +00:00
Reverse order of messaging messages
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2018 Avatao.com Innovative Learning Kft.
|
||||
// All Rights Reserved. See LICENSE file for details.
|
||||
|
||||
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { ChangeDetectorRef, Component, OnInit, EventEmitter, Output } from '@angular/core';
|
||||
import { MarkdownService } from '../services/markdown.service';
|
||||
import { WebSocketService } from '../services/websocket.service';
|
||||
|
||||
@ -18,6 +18,7 @@ import { Subject, Observer, BehaviorSubject } from 'rxjs';
|
||||
styleUrls: ['./messages.component.scss']
|
||||
})
|
||||
export class MessagesComponent implements OnInit {
|
||||
@Output() newMessageEvent: EventEmitter<any> = new EventEmitter();
|
||||
newMessage: Subject<MessagesMessage> = new Subject<MessagesMessage>();
|
||||
messageInQueue = true;
|
||||
|
||||
@ -38,7 +39,11 @@ export class MessagesComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.newMessage.subscribe(this.writeMessage.bind(this));
|
||||
this.newMessage.subscribe(
|
||||
(message) => {
|
||||
this.writeMessage(message);
|
||||
this.newMessageEvent.emit();
|
||||
});
|
||||
this.messageQueueAttender.messageInQueue.subscribe(
|
||||
(value) => this.messageInQueue = value
|
||||
);
|
||||
|
Reference in New Issue
Block a user