Skip to content

Instantly share code, notes, and snippets.

@freshcutdevelopment
Created October 23, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freshcutdevelopment/3876229b27ec55c916e71b22f6f0ca39 to your computer and use it in GitHub Desktop.
Save freshcutdevelopment/3876229b27ec55c916e71b22f6f0ca39 to your computer and use it in GitHub Desktop.
Aurelia messaging app
import {inject} from 'aurelia-framework';
import {EventAggregator} from 'aurelia-event-aggregator';
@inject(EventAggregator)
export class Messenger{
constructor(eventAggregator){
this.ea = eventAggregator;
this.message = "";
}
sendMessage(){
this.ea.publish('new-message', this.message);
this.message = "";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment