Created
October 23, 2016 19:23
-
-
Save freshcutdevelopment/3876229b27ec55c916e71b22f6f0ca39 to your computer and use it in GitHub Desktop.
Aurelia messaging app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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