Skip to content

Instantly share code, notes, and snippets.

@jmezach
Forked from lebolo/app.html
Created February 21, 2017 15:14
Show Gist options
  • Save jmezach/d9aba645332d286d2c9f20df61a621c9 to your computer and use it in GitHub Desktop.
Save jmezach/d9aba645332d286d2c9f20df61a621c9 to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<require from="./dropdown"></require>
<h1>${message}</h1>
<dropdown>
<p repeat.for="item of items">${item}</p>
</dropdown>
<a click.delegate="changeItems()" href="#">Change items</a>
</template>
export class App {
message = 'Hello World!';
items = ['Item 1', 'Item 2'];
changeItems() {
this.items = ['Item 3', 'Item 4'];
}
}
<template>
<h1>${set}</h1>
<slot></slot>
</template>
import { children } from 'aurelia-framework';
export class Dropdown {
@children('dropdown-item') dropdownItems = [];
set = 'First set';
dropdownItemsChanged() {
this.set = 'Second set';
}
}
<!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