Matteo Scandolo | fc4b37b | 2017-02-02 12:18:47 -0800 | [diff] [blame] | 1 | class 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 | |
| 23 | export const xosDemoComponent: angular.IComponentOptions = { |
| 24 | template: require('./demo.html'), |
| 25 | controllerAs: 'vm', |
| 26 | controller: DemoComponent |
| 27 | }; |