CORD-582, CORD-734 Registering events listeners for keyboard shortcuts
and displaying them in the side panel

Change-Id: Ifbb227b3a425be5c33d1fe211abd473209414896
diff --git a/src/app/core/side-panel/side-panel.service.ts b/src/app/core/side-panel/side-panel.service.ts
index a7471f5..96e4162 100644
--- a/src/app/core/side-panel/side-panel.service.ts
+++ b/src/app/core/side-panel/side-panel.service.ts
@@ -5,10 +5,11 @@
   open(): void;
   close(): void;
   injectComponent(componentName: string, attributes?: any, transclude?: string): void;
+  removeInjectedComponents(): void;
 }
 
 export class XosSidePanel implements IXosSidePanelService {
-  static $inject = ['$rootScope', '$compile', 'XosComponentInjector'];
+  static $inject = ['$rootScope', '$compile', '$timeout', 'XosComponentInjector'];
   public sidePanelElName = 'xos-side-panel';
   public sidePanelElClass = '.xos-side-panel';
   public sidePanelEl: JQuery;
@@ -16,6 +17,7 @@
   constructor (
     private $rootScope: ng.IRootScopeService,
     private $compile: ng.ICompileService,
+    private $timeout: ng.ITimeoutService,
     private XosComponentInjector: IXosComponentInjectorService
   ) {
     this.sidePanelEl = $(`${this.sidePanelElName} > ${this.sidePanelElClass}`);
@@ -33,4 +35,11 @@
     this.XosComponentInjector.injectComponent('#side-panel-container', componentName, attributes, transclude, true);
     this.open();
   }
+
+  public removeInjectedComponents() {
+    this.close();
+    this.$timeout(() => {
+      this.XosComponentInjector.removeInjectedComponents('#side-panel-container');
+    }, 500);
+  }
 }