blob: d9305ddf6b187dbc89cd63fcdddc84c878c18844 [file] [log] [blame]
Israel Lavi1994c982018-05-21 17:42:00 +03001import { createLab } from '@islavi/ng2-component-lab';
2import { ComponentsModule } from './../stories/ng2-component-lab/components.module';
3
4const themeName:string = 'default';
5//const themeName:string = '1802';
6
7// Select the theme
8if (themeName === '1802') {
9 require('./themes/ng2-component-lab-theme-1802.scss');
10} else {
11 // Default theme
12 require('./ng2-component-lab.scss');
13}
14
15createLab({
16 /**
17 * NgModule to import. All components and pipes must be exported
18 * by this module to be useable in your experiments
19 */
20 ngModule: ComponentsModule,
21 /**
22 * Function that returns an array of experiments.
23 *
24 * Here is an example using webpack's `require.context` to
25 * load all modules ending in `.exp.ts` and returning thier
26 * default exports as an array:
27 */
28 loadExperiments() {
29 const context = (require as any).context('./../stories/ng2-component-lab', true, /\.exp\.ts/);
30 var result = context.keys().map(context).map(mod => mod.default);
31 context.keys().forEach(key => {
32 console.log("Going to require: " + key);
33 });
34 return result;
35 }
36});