framework/ember/app/controllers/alerts.js

18 lines
364 B
JavaScript
Raw Normal View History

2015-02-08 13:21:40 +08:00
import Ember from 'ember';
export default Ember.Controller.extend({
alerts: [],
2015-02-08 13:21:40 +08:00
actions: {
alert: function(message) {
this.get('alerts').pushObject(message);
},
dismissAlert: function(message) {
2015-02-26 10:58:44 +08:00
this.get('alerts').removeObject(message.constructor);
},
clearAlerts: function() {
this.get('alerts').clear();
}
}
2015-02-08 13:21:40 +08:00
});