Skip to content

Instantly share code, notes, and snippets.

@Thanood
Forked from JeroenVinke/app.html
Last active January 18, 2017 11:26
Show Gist options
  • Save Thanood/4306fba19bdcef14e5d4b12ffb97207c to your computer and use it in GitHub Desktop.
Save Thanood/4306fba19bdcef14e5d4b12ffb97207c to your computer and use it in GitHub Desktop.
Aurelia skeleton
<template>
<select value.two-way="selectedMeal">
<option disabled model.bind="null">Select your meal</option>
<option repeat.for="meal of food" model.bind="meal">${meal.name}</option>
</select>
</template>
export class App {
food = [
{ id: 0, name: 'Pizza' },
{ id: 1, name: 'Cake' },
{ id: 2, name: 'Steak' },
{ id: 3, name: 'Pasta' },
{ id: 4, name: 'Fries' }
];
selectedMeal = null;
setSelectedMeal() {
this.selectedMeal = this.food[2];
}
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body aurelia-app="main">
<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>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
aurelia.start().then(() => aurelia.setRoot());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment