Skip to content

Instantly share code, notes, and snippets.

@HIRANO-Satoshi
Created May 10, 2018 06:55
Show Gist options
  • Save HIRANO-Satoshi/5fb09ae22cb2e44b96f2a46bece5d333 to your computer and use it in GitHub Desktop.
Save HIRANO-Satoshi/5fb09ae22cb2e44b96f2a46bece5d333 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div aurelia-app="src/configure">
Loading...
</div>
<script src="https://rawgit.com/aurelia-ui-toolkits/demo-materialize/gh-pages/jspm_packages/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/demo-materialize/gh-pages/jspm.config.js"></script>
<script>
System.import("aurelia-bootstrapper");
</script>
</body>
</html>
<template>
<md-radio repeat.for="color of colors" name="color" model.bind="color" checked.bind="selectedColor">${color.name}</md-radio>
<p>Your choice: ${selectedColor | stringify}</p>
</template>
export class App {
colors = [
{ name: "red", hex: "#ff0000" },
{ name: "green", hex: "#00ff00" },
{ name: "blue", hex: "#0000ff" }
];
selectedColor = this.colors[1];
}
// tslint:disable-next-line:max-classes-per-file
export class StringifyValueConverter {
toView(value) {
return JSON.stringify(value);
}
}
export async function configure(aurelia) {
await aurelia.loader.loadModule("materialize-css");
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin("aurelia-materialize-bridge", bridge => bridge.useAll())
.plugin("aurelia-validation")
.globalResources("src/shared/logger");
await aurelia.start();
aurelia.setRoot("src/app");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment