Matteo Scandolo | fc4b37b | 2017-02-02 12:18:47 -0800 | [diff] [blame] | 1 | /// <reference path="../typings/index.d.ts" /> |
| 2 | import * as angular from 'angular'; |
| 3 | |
| 4 | import 'angular-ui-router'; |
| 5 | import 'angular-resource'; |
| 6 | import 'angular-cookies'; |
| 7 | import routesConfig from './routes'; |
| 8 | import {xosDemoComponent} from './app/components/demo'; |
| 9 | import {xosDashboardExtensionComponent} from './app/components/dashboard-extension'; |
| 10 | |
| 11 | |
| 12 | |
| 13 | angular.module('xos-sample-gui-extension', [ |
| 14 | 'ui.router', |
Matteo Scandolo | da6c4ed | 2017-07-13 11:50:59 -0700 | [diff] [blame] | 15 | 'app' |
Matteo Scandolo | fc4b37b | 2017-02-02 12:18:47 -0800 | [diff] [blame] | 16 | ]) |
| 17 | .config(routesConfig) |
| 18 | .component('demo', xosDemoComponent) |
| 19 | .component('dashboardExtension', xosDashboardExtensionComponent) |
| 20 | .run(function( |
| 21 | $log: ng.ILogService, |
| 22 | $state: ng.ui.IStateService, |
Matteo Scandolo | a120cfd | 2017-02-06 16:03:36 -0800 | [diff] [blame] | 23 | XosNavigationService: any, |
Matteo Scandolo | fc4b37b | 2017-02-02 12:18:47 -0800 | [diff] [blame] | 24 | XosComponentInjector: any, |
| 25 | XosKeyboardShortcut: any) { |
| 26 | $log.info('[xos-sample-gui-extension] App is running'); |
| 27 | |
Matteo Scandolo | a120cfd | 2017-02-06 16:03:36 -0800 | [diff] [blame] | 28 | XosNavigationService.add({ |
Matteo Scandolo | fc4b37b | 2017-02-02 12:18:47 -0800 | [diff] [blame] | 29 | label: 'Example Extension', |
| 30 | state: 'xos.xos-sample-gui-extension.example-route', |
| 31 | }); |
| 32 | |
| 33 | XosComponentInjector.injectComponent( |
| 34 | '#dashboard-component-container', |
| 35 | 'dashboardExtension', |
| 36 | {}, |
| 37 | '', |
| 38 | false |
| 39 | ); |
| 40 | |
| 41 | XosKeyboardShortcut.registerKeyBinding({ |
| 42 | key: 'd', |
| 43 | description: 'Alert popup', |
| 44 | cb: () => { |
| 45 | alert('This binding is provided by the "xos-sample-gui-extension"'); |
| 46 | }, |
| 47 | }, 'global'); |
| 48 | }); |