framework/ember/app/controllers/alerts.js

18 lines
328 B
JavaScript
Raw Normal View History

2015-02-08 13:21:40 +08:00
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);
},
clearAlerts: function() {
this.get('alerts').clear();
}
}
});