Matteo Scandolo | 63e43eb | 2016-12-14 14:18:53 -0800 | [diff] [blame^] | 1 | import './header.scss'; |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 2 | import {StyleConfig} from '../../config/style.config'; |
Matteo Scandolo | 63e43eb | 2016-12-14 14:18:53 -0800 | [diff] [blame^] | 3 | import {IStoreService} from '../../datasources/stores/slices.store'; |
| 4 | import {IWSEvent} from '../../datasources/websocket/global'; |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 5 | |
| 6 | class HeaderController { |
Matteo Scandolo | 63e43eb | 2016-12-14 14:18:53 -0800 | [diff] [blame^] | 7 | static $inject = ['SynchronizerStore']; |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 8 | public title: string; |
Matteo Scandolo | 63e43eb | 2016-12-14 14:18:53 -0800 | [diff] [blame^] | 9 | public notifications: IWSEvent[] = []; |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 10 | |
Matteo Scandolo | 63e43eb | 2016-12-14 14:18:53 -0800 | [diff] [blame^] | 11 | constructor( |
| 12 | private syncStore: IStoreService |
| 13 | ) { |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 14 | this.title = StyleConfig.projectName; |
Matteo Scandolo | 63e43eb | 2016-12-14 14:18:53 -0800 | [diff] [blame^] | 15 | |
| 16 | this.syncStore.query() |
| 17 | .subscribe( |
| 18 | (event: IWSEvent) => { |
| 19 | console.log(event); |
| 20 | this.notifications.push(event); |
| 21 | } |
| 22 | ); |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 23 | } |
| 24 | } |
| 25 | |
| 26 | export const xosHeader: angular.IComponentOptions = { |
| 27 | template: require('./header.html'), |
| 28 | controllerAs: 'vm', |
| 29 | controller: HeaderController |
| 30 | }; |