Skip to content

Instantly share code, notes, and snippets.

@AshleyGrant
Last active July 12, 2017 01:12
Show Gist options
  • Save AshleyGrant/76892007e274b737ebff9f170c91c238 to your computer and use it in GitHub Desktop.
Save AshleyGrant/76892007e274b737ebff9f170c91c238 to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<div repeat.for="section of sections" ref="$root" index.bind="$index">
${section.name}, $index = ${$index}
<div repeat.for="row of section.rows">
${row.name}
<div repeat.for="component of row.components">
${component} $root.$index = ${$root.index}
</div>
</div>
</div>
</template>
export class App {
sections = [{
name: 'Section 1',
rows: [{
name: 'row 1:1',
components: [ 'component 1:1:1', 'component 1:1:2']
}
,{
name: 'row 1:2',
components: [ 'component 1:2:1', 'component 1:2:2']
}]
},{
name: 'Section 2',
rows: [{
name: 'row 2:1',
components: [ 'component 2:1:1', 'component 2:1:2']
}
,{
name: 'row 2:2',
components: [ 'component 2:2:1', 'component 2:2:2']
}]
}]
}
<!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