blob: cf6bbc4b53353fb24e8c4e939ea102708e660959 [file] [log] [blame]
Matteo Scandolofc4b37b2017-02-02 12:18:47 -08001/// <reference path="../typings/index.d.ts" />
2import * as angular from 'angular';
3
4import 'angular-ui-router';
5import 'angular-resource';
6import 'angular-cookies';
7import routesConfig from './routes';
8import {xosDemoComponent} from './app/components/demo';
9import {xosDashboardExtensionComponent} from './app/components/dashboard-extension';
10
11
12
13angular.module('xos-sample-gui-extension', [
14 'ui.router',
Matteo Scandolo2b16ea12017-07-13 11:50:59 -070015 'app'
Matteo Scandolofc4b37b2017-02-02 12:18:47 -080016 ])
17 .config(routesConfig)
18 .component('demo', xosDemoComponent)
19 .component('dashboardExtension', xosDashboardExtensionComponent)
20 .run(function(
21 $log: ng.ILogService,
22 $state: ng.ui.IStateService,
Matteo Scandoloa120cfd2017-02-06 16:03:36 -080023 XosNavigationService: any,
Matteo Scandolofc4b37b2017-02-02 12:18:47 -080024 XosComponentInjector: any,
25 XosKeyboardShortcut: any) {
26 $log.info('[xos-sample-gui-extension] App is running');
27
Matteo Scandoloa120cfd2017-02-06 16:03:36 -080028 XosNavigationService.add({
Matteo Scandolofc4b37b2017-02-02 12:18:47 -080029 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 });