aboutsummaryrefslogtreecommitdiffstats
path: root/.ng2-component-lab/lab-configuration.module.ts
diff options
context:
space:
mode:
authorIsrael Lavi <israel.lavi@intl.att.com>2018-05-21 17:42:00 +0300
committerIsrael Lavi <il0695@att.com>2018-05-21 17:52:01 +0300
commit1994c98063c27a41797dec01f2ca9fcbe33ceab0 (patch)
treef30beeaf15a8358f6da78fdd74bcbda74bd334f8 /.ng2-component-lab/lab-configuration.module.ts
parent4749f4631426fcbe29ed98cef8f24cab18b501d0 (diff)
init commit onap ui
Change-Id: I1dace78817dbba752c550c182dfea118b4a38646 Issue-ID: SDC-1350 Signed-off-by: Israel Lavi <il0695@att.com>
Diffstat (limited to '.ng2-component-lab/lab-configuration.module.ts')
-rw-r--r--.ng2-component-lab/lab-configuration.module.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/.ng2-component-lab/lab-configuration.module.ts b/.ng2-component-lab/lab-configuration.module.ts
new file mode 100644
index 0000000..d9305dd
--- /dev/null
+++ b/.ng2-component-lab/lab-configuration.module.ts
@@ -0,0 +1,36 @@
+import { createLab } from '@islavi/ng2-component-lab';
+import { ComponentsModule } from './../stories/ng2-component-lab/components.module';
+
+const themeName:string = 'default';
+//const themeName:string = '1802';
+
+// Select the theme
+if (themeName === '1802') {
+ require('./themes/ng2-component-lab-theme-1802.scss');
+} else {
+ // Default theme
+ require('./ng2-component-lab.scss');
+}
+
+createLab({
+ /**
+ * NgModule to import. All components and pipes must be exported
+ * by this module to be useable in your experiments
+ */
+ ngModule: ComponentsModule,
+ /**
+ * Function that returns an array of experiments.
+ *
+ * Here is an example using webpack's `require.context` to
+ * load all modules ending in `.exp.ts` and returning thier
+ * default exports as an array:
+ */
+ loadExperiments() {
+ const context = (require as any).context('./../stories/ng2-component-lab', true, /\.exp\.ts/);
+ var result = context.keys().map(context).map(mod => mod.default);
+ context.keys().forEach(key => {
+ console.log("Going to require: " + key);
+ });
+ return result;
+ }
+});