blob: a8791d7b7fd4b50e8c1a2e2ca327b2e9dc56d33f [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',
15 'xosCore'
16 ])
17 .config(routesConfig)
18 .component('demo', xosDemoComponent)
19 .component('dashboardExtension', xosDashboardExtensionComponent)
20 .run(function(
21 $log: ng.ILogService,
22 $state: ng.ui.IStateService,
23 NavigationService: any,
24 XosComponentInjector: any,
25 XosKeyboardShortcut: any) {
26 $log.info('[xos-sample-gui-extension] App is running');
27
28 NavigationService.add({
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 });