Skip to content

Instantly share code, notes, and snippets.

@haiau79
Forked from charlespockert/app.html
Last active May 17, 2016 18:30
Show Gist options
  • Save haiau79/bea803b05ad8d5b5e3e0afd59bb8dbb1 to your computer and use it in GitHub Desktop.
Save haiau79/bea803b05ad8d5b5e3e0afd59bb8dbb1 to your computer and use it in GitHub Desktop.
<template>
<require from="./button-row"></require>
<button-row repeat.for="btnRow of btnRowArray"></button-row>
</template>
import {ButtonRow} from 'button-row';
export class Test {
//btns = ["On", "Off", "Reset", "Test", "Hello"];
btnRow1 = new ButtonRow("Nav", ["On", "Off", "Reset", "Test", "Hello"]);
btnRow2 = new ButtonRow("Strobe", ["On", "Off", "Reset", "Test", "Hello"]);
btnRowArray = [this.btnRow1, this.btnRow2];
}
<template>
<div>
${label}
<button repeat.for="button of btns" class="btn btn-primary">${button}</button>
</div>
</template>
export class ButtonRow {
// label: string = "Nav";
// btns = ["On", "Off", "Reset", "Test", "Hello"];
label;
btns;
constructor(label, btns) {
this.label = label;
this.btns = btns;
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></link>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
<script src="https://cdn.rawgit.com/valichek/aurelia-bundle/i18n-0.5.2v0.0.4/config.js"></script>
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
aurelia.start().then(() => aurelia.setRoot());
}
/* todo: add styles */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment