Skip to content

Instantly share code, notes, and snippets.

@jsobell
Forked from taosd/app.html
Created July 27, 2018 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsobell/1a5c97fc5a62fed9fee4b60206c26626 to your computer and use it in GitHub Desktop.
Save jsobell/1a5c97fc5a62fed9fee4b60206c26626 to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<require from='thingy'></require>
<h1>${message}</h1>
<ul>
<li repeat.for="option of allOptions">
<input type="checkbox" checked.bind="selectedOptions" matcher.bind="matcher" model.bind="option">
${option.text}
</li>
</ul>
Here's a thingy:<br/>
<thingy></thingy>
</template>
export class App {
message = 'Hello World!';
allOptions = [{ text: 'red'},{ text: 'blue'},{ text: 'green'},{ text: 'pink'}];
selectedOptions = [];
created() {
this.selectedOptions.push({ text: 'red'});
}
attached() {
this.selectedOptions.push({ text: 'green'})
}
matcher(a,b) {
return a.text === b.text;
}
}
<!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://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script>
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
.bigthingy {
font-size: 30px;
}
<template>
<require from="thingy.css"></require>
<div class='bigthingy'>
This is a thingy template!
</div>
</template>
import {customElement} from "aurelia-framework";
@customElement('thingy')
export class thingy {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment