2016-06-30 21:14:25 +03:00
|
|
|
import Component from 'ember-component';
|
|
|
|
import {alias} from 'ember-computed';
|
|
|
|
import injectService from 'ember-service/inject';
|
|
|
|
import observer from 'ember-metal/observer';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
export default Component.extend({
|
2015-05-21 20:03:24 +03:00
|
|
|
tagName: 'aside',
|
|
|
|
classNames: 'gh-alerts',
|
|
|
|
|
2016-06-30 21:14:25 +03:00
|
|
|
notifications: injectService(),
|
2015-05-21 20:03:24 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
messages: alias('notifications.alerts'),
|
2015-05-21 20:03:24 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
messageCountObserver: observer('messages.[]', function () {
|
2015-05-21 20:03:24 +03:00
|
|
|
this.sendAction('notify', this.get('messages').length);
|
|
|
|
})
|
|
|
|
});
|