Skip to content

Instantly share code, notes, and snippets.

@Nepoxx
Forked from jdanyow/app.html
Created September 30, 2016 17:59
Show Gist options
  • Select an option

  • Save Nepoxx/7f5cc272d90638da5ee5ceddafcec2ee to your computer and use it in GitHub Desktop.

Select an option

Save Nepoxx/7f5cc272d90638da5ee5ceddafcec2ee to your computer and use it in GitHub Desktop.

Revisions

  1. Nepoxx revised this gist Sep 30, 2016. 7 changed files with 45 additions and 2 deletions.
    21 changes: 20 additions & 1 deletion app.html
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,22 @@
    <template>
    <h1>${message}</h1>
    <require from="keys"></require>
    <require from="stringTypeOf"></require>
    <require from="titlerize"></require>
    <form class="form-horizontal form-label-left input_mask">
    <div class="form-group" repeat.for="key of data | keys">
    Key: ${key}, Value: ${data[key]}
    <br>
    <label class="control-label col-md-3 col-sm-3 col-xs-12">Title: ${key | titlerize}</label>

    <div class="col-md-9 col-sm-9 col-xs-12">
    Compose:<compose view-model="${data[key] | stringTypeOf}-form"
    view="${data[key] | stringTypeOf}-form.html"
    model.bind="data[key]"></compose>
    <br>
    Direct:<input type="number" class="form-control" placeholder="0" min="0" value.bind="data[key]">
    </div>
    </div>
    <div class="ln_solid"></div>
    </form>
    </template>
    6
    2 changes: 1 addition & 1 deletion app.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    export class App {
    message = 'Hello World!';
    data = {a: 5};
    }
    5 changes: 5 additions & 0 deletions keys.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    export class KeysValueConverter {
    toView(object) {
    return Object.keys(object);
    }
    }
    3 changes: 3 additions & 0 deletions number-form.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    <template>
    <input type="number" class="form-control" placeholder="0" min="0" value.bind="model">
    </template>
    5 changes: 5 additions & 0 deletions number-form.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    export class NumberForm {
    activate(model) {
    this.model = model;
    }
    }
    5 changes: 5 additions & 0 deletions stringTypeOf.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    export class StringTypeOfValueConverter {
    toView(object) {
    return typeof object;
    }
    }
    6 changes: 6 additions & 0 deletions titlerize.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    export class TitlerizeValueConverter {
    toView(camelCaseString) {
    const string = camelCaseString.replace(/([A-Z]+)/g, " $1");
    return string.charAt(0).toUpperCase() + string.slice(1);
    }
    }
  2. @jdanyow jdanyow revised this gist Sep 20, 2016. 1 changed file with 1 addition and 6 deletions.
    7 changes: 1 addition & 6 deletions app.html
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,3 @@
    <template>
    <label>
    <input type="checkbox" ref="showHeader" checked="true">
    Show Header?
    </label>
    <h1 if.bind="showHeader.checked" ref="theHeader">${message}</h1>
    The header is: ${theHeader}
    <h1>${message}</h1>
    </template>
  3. @jdanyow jdanyow revised this gist Sep 20, 2016. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion app.html
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    <template>
    <h1>${message}</h1>
    <label>
    <input type="checkbox" ref="showHeader" checked="true">
    Show Header?
    </label>
    <h1 if.bind="showHeader.checked" ref="theHeader">${message}</h1>
    The header is: ${theHeader}
    </template>
  4. @jdanyow jdanyow revised this gist Apr 12, 2016. No changes.
  5. @jdanyow jdanyow revised this gist Apr 11, 2016. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -7,10 +7,12 @@
    <body aurelia-app>
    <h1>Loading...</h1>

    <script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script>
    <script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script>
    <script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script>
    <script src="https://jdanyow.github.io/rjs-bundle/config.js"></script>
    <script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script>
    <script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script>
    <script>
    System.import('aurelia-bootstrapper');
    require(['aurelia-bootstrapper']);
    </script>
    </body>
    </html>
  6. @jdanyow jdanyow revised this gist Mar 6, 2016. 3 changed files with 3 additions and 23 deletions.
    7 changes: 3 additions & 4 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -2,14 +2,13 @@
    <html>
    <head>
    <title>Aurelia</title>
    <link rel="stylesheet" href="styles.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body aurelia-app="main">
    <body aurelia-app>
    <h1>Loading...</h1>

    <script src="https://cdn.rawgit.com/jdanyow/aurelia-plunker/v0.11.10/jspm_packages/system.js"></script>
    <script src="https://cdn.rawgit.com/jdanyow/aurelia-plunker/v0.11.10/config2.js"></script>
    <script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script>
    <script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script>
    <script>
    System.import('aurelia-bootstrapper');
    </script>
    17 changes: 0 additions & 17 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -1,17 +0,0 @@
    /*******************************************************************************
    * The following two lines enable async/await without using babel's
    * "runtime" transformer. Uncomment the lines if you intend to use async/await.
    *
    * More info here: https://github.com/jdanyow/aurelia-plunker/issues/2
    */
    //import regeneratorRuntime from 'babel-runtime/regenerator';
    //window.regeneratorRuntime = regeneratorRuntime;
    /******************************************************************************/

    export function configure(aurelia) {
    aurelia.use
    .standardConfiguration()
    .developmentLogging();

    aurelia.start().then(a => a.setRoot());
    }
    2 changes: 0 additions & 2 deletions styles.css
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    /* Styles go here */

  7. @jdanyow jdanyow created this gist Feb 22, 2016.
    3 changes: 3 additions & 0 deletions app.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    <template>
    <h1>${message}</h1>
    </template>
    3 changes: 3 additions & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    export class App {
    message = 'Hello World!';
    }
    17 changes: 17 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <!doctype html>
    <html>
    <head>
    <title>Aurelia</title>
    <link rel="stylesheet" href="styles.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body aurelia-app="main">
    <h1>Loading...</h1>

    <script src="https://cdn.rawgit.com/jdanyow/aurelia-plunker/v0.11.10/jspm_packages/system.js"></script>
    <script src="https://cdn.rawgit.com/jdanyow/aurelia-plunker/v0.11.10/config2.js"></script>
    <script>
    System.import('aurelia-bootstrapper');
    </script>
    </body>
    </html>
    17 changes: 17 additions & 0 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    /*******************************************************************************
    * The following two lines enable async/await without using babel's
    * "runtime" transformer. Uncomment the lines if you intend to use async/await.
    *
    * More info here: https://github.com/jdanyow/aurelia-plunker/issues/2
    */
    //import regeneratorRuntime from 'babel-runtime/regenerator';
    //window.regeneratorRuntime = regeneratorRuntime;
    /******************************************************************************/

    export function configure(aurelia) {
    aurelia.use
    .standardConfiguration()
    .developmentLogging();

    aurelia.start().then(a => a.setRoot());
    }
    2 changes: 2 additions & 0 deletions styles.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    /* Styles go here */