Skip to content

Instantly share code, notes, and snippets.

@AshleyGrant
Forked from ziadloo/app.html
Created October 13, 2016 19:24
Show Gist options
  • Select an option

  • Save AshleyGrant/1c4c93f0d472729490e2934b06e14b50 to your computer and use it in GitHub Desktop.

Select an option

Save AshleyGrant/1c4c93f0d472729490e2934b06e14b50 to your computer and use it in GitHub Desktop.
<template>
<require from="./list"></require>
<require from="./row"></require>
<list rows.bind="users">
<template replace-part="row-template">
<row name.bind="row.name"></row>
</template>
</list>
</template>
export class App
{
users = [{name: "Joe"}, {name: "Jack"}, {name: "Jill"}];
}
<!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.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
</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>
<template>
The List
<ol>
<li repeat.for="row of rows">
<template replaceable part="row-template">
${row}
</template>
</li>
</ol>
</template>
import { bindable } from 'aurelia-framework';
export class List
{
@bindable
rows = [{name: "John"}];
}
<template>
<span>${name}</span>
</template>
import { bindable } from 'aurelia-framework';
export class Row
{
@bindable name = "Marry";
}
console.log('Hello World!');
/* todo: add styles */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment