add toggle function to XosSidePanel
Change-Id: I06c0c70443a586cb16cbd7fe1b14a037e530df5d
diff --git a/src/app/core/side-panel/side-panel.service.ts b/src/app/core/side-panel/side-panel.service.ts
index 6857f7d..1903b9e 100644
--- a/src/app/core/side-panel/side-panel.service.ts
+++ b/src/app/core/side-panel/side-panel.service.ts
@@ -52,4 +52,15 @@
this.hasComponentLoaded = false;
}, 500);
}
+
+ public toggleComponent(componentName: string, attributes?: any, transclude?: string) {
+ this.componentToggle = !this.componentToggle;
+ if (this.componentToggle) {
+ this.XosComponentInjector.injectComponent('#side-panel-container', componentName, attributes, transclude, true);
+ this.open();
+ }
+ else {
+ this.removeInjectedComponents();
+ }
+ }
}