Skip to content

Instantly share code, notes, and snippets.

@Vheissu
Last active June 28, 2017 10:24
Show Gist options
  • Save Vheissu/1fb91f52f659cecfb74cb61e58afbeeb to your computer and use it in GitHub Desktop.
Save Vheissu/1fb91f52f659cecfb74cb61e58afbeeb to your computer and use it in GitHub Desktop.
Example of a simple string loop in Aurelia
<template>
<ul>
<li repeat.for="name of names">${name}</li>
</ul>
<ol>
<li repeat.for="name of nameObjects">${name.name} has made ${name.commits} commits.</li>
</ol>
</template>
export class App {
constructor() {
this.names = ['Rob', 'Jeremy', 'Ashley', 'Dwayne'];
this.nameObjects = [
{name: 'Rob', commits: 100},
{name: 'Jeremy', commits: 74},
{name: 'Ashley', commits: 23},
{name: 'Dwayne', commits: 4}
];
}
}
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment