diff --git a/demos/config/index.html b/demos/config/index.html new file mode 100644 index 0000000000..b75ceae421 --- /dev/null +++ b/demos/config/index.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/config/index.ts b/demos/config/index.ts index ce67af60a6..f02f6d7e5a 100644 --- a/demos/config/index.ts +++ b/demos/config/index.ts @@ -27,7 +27,7 @@ export class TabPage { export class InitialPage { constructor(platform: Platform) { this.platform = platform; - if (window.localStorage.getItem('configDemo') !== "{}") { + if (window.localStorage.getItem('configDemo') !== null) { debugger; this.config = JSON.parse(window.localStorage.getItem('configDemo')); } @@ -48,6 +48,7 @@ export class InitialPage { load() { window.localStorage.setItem('configDemo', JSON.stringify(this.config)); + console.log('saving', this.config); window.location.reload(); } } diff --git a/gulpfile.js b/gulpfile.js index de01405bcb..9a086a2408 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -475,8 +475,11 @@ gulp.task('build.demos', function(){ function createIndexHTML() { return through2.obj(function(file, enc, next) { var indexTemplate = baseIndexTemplate; + var customTemplateFp = file.path.split('/').slice(0, -1).join('/') + '/index.html'; if (file.path.indexOf('component-docs') > -1) { indexTemplate = docsIndexTemplate; + } else if (fs.existsSync(customTemplateFp)) { + indexTemplate = _.template(fs.readFileSync(customTemplateFp))(); } this.push(new VinylFile({ base: file.base,