Skip to content

Instantly share code, notes, and snippets.

@Vheissu
Created September 12, 2016 11:46
Show Gist options
  • Select an option

  • Save Vheissu/30226818a42f61cb93eb0229ec87d32a to your computer and use it in GitHub Desktop.

Select an option

Save Vheissu/30226818a42f61cb93eb0229ec87d32a to your computer and use it in GitHub Desktop.

Revisions

  1. Vheissu revised this gist Sep 12, 2016. 2 changed files with 9 additions and 8 deletions.
    8 changes: 4 additions & 4 deletions app.html
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    <template>
    <form role="form">
    <label repeat.for="option of someOptions">
    <input type="radio" value.bind="option" checked.bind="selectedOptions">${option}
    </label>
    <select value.bind="selectedVal">
    <option repeat.for="option of someOptions" value.bind="option">${option}</option>
    </select>
    <br><br>
    <strong>Options selected: </strong>${selectedOptions}
    <strong>Selected value: </strong>${selectedVal}
    </form>
    </template>
    9 changes: 5 additions & 4 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    export class App {
    constructor() {
    this.selectedOptions = [];
    this.someOptions = ['Option 1', 'Option 2', 'Option 3'];
    }
    constructor() {
    this.selectedVal = 3;

    this.someOptions = ['Option 1', 'Option 2', 'Option 3'];
    }
    }
  2. Vheissu revised this gist Sep 12, 2016. No changes.
  3. Vheissu created this gist Sep 12, 2016.
    9 changes: 9 additions & 0 deletions app.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <template>
    <form role="form">
    <label repeat.for="option of someOptions">
    <input type="radio" value.bind="option" checked.bind="selectedOptions">${option}
    </label>
    <br><br>
    <strong>Options selected: </strong>${selectedOptions}
    </form>
    </template>
    6 changes: 6 additions & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    export class App {
    constructor() {
    this.selectedOptions = [];
    this.someOptions = ['Option 1', 'Option 2', 'Option 3'];
    }
    }
    18 changes: 18 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <!doctype html>
    <html>
    <head>
    <title>Aurelia</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body aurelia-app>
    <h1>Loading...</h1>

    <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>
    require(['aurelia-bootstrapper']);
    </script>
    </body>
    </html>