Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Aurelia messaging app - List
import {inject} from 'aurelia-framework';
import {EventAggregator} from 'aurelia-event-aggregator';
export class MessageList{
this.eventAggregator = eventAggregator;
this.messages = [];
this.messageReceivedSubscription = this.eventAggregator.subscribe('new-message', message => {
this.messages.unshift({ message: message, date: new Date() });
detached() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment