framework/ember/app/controllers/alerts.js
2015-02-26 13:28:44 +10:30

18 lines
364 B
JavaScript

import Ember from 'ember';
export default Ember.Controller.extend({
alerts: [],
actions: {
alert: function(message) {
this.get('alerts').pushObject(message);
},
dismissAlert: function(message) {
this.get('alerts').removeObject(message.constructor);
},
clearAlerts: function() {
this.get('alerts').clear();
}
}
});