blob: 14fb3db73e76883b38aeeb8247ecbea3c7180c68 [file] [log] [blame]
Matteo Scandolofc4b37b2017-02-02 12:18:47 -08001class DemoComponent {
2 static $inject = ['XosSidePanel', 'XosKeyboardShortcut'];
3
4 constructor(
5 private XosSidePanel: any,
6 private XosKeyboardShortcut: any
7 ) {
8 this.XosKeyboardShortcut.registerKeyBinding({
9 key: 'v',
10 description: 'Alert popup',
11 cb: () => {
12 alert('This binding is provided by the "xos-sample-gui-extension"');
13 },
14 }, 'view');
15 }
16
17 togglePanel() {
18 this.XosSidePanel.injectComponent('xosAlert', {config: {type: 'info'}, show: true}, 'This content is injected by my sample UI extension');
19 }
20
21}
22
23export const xosDemoComponent: angular.IComponentOptions = {
24 template: require('./demo.html'),
25 controllerAs: 'vm',
26 controller: DemoComponent
27};