-
-
Save jsobell/1a5c97fc5a62fed9fee4b60206c26626 to your computer and use it in GitHub Desktop.
Aurelia Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bigthingy { | |
font-size: 30px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="thingy.css"></require> | |
<div class='bigthingy'> | |
This is a thingy template! | |
</div> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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