Created
April 25, 2016 15:09
-
-
Save mbroadst/7dc013db173bafff95620eda6190a487 to your computer and use it in GitHub Desktop.
Aurelia RequireJS 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="./grid"></require> | |
<require from="./column"></require> | |
<grid> | |
<column header="blah"></column> | |
<column header="test"></column> | |
<column header="thing"></column> | |
<column header="balloons"></column> | |
</grid> | |
</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 { | |
} |
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 { | |
inject, | |
bindable, | |
noView, | |
processContent | |
} from 'aurelia-framework'; | |
@noView | |
@processContent(false) | |
@inject(Element) | |
export class Column { | |
@bindable header | |
} |
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> | |
<content></content> | |
<table ref="table" border=1> | |
<thead> | |
<tr> | |
<th repeat.for="column of columns"> | |
${column.header} | |
</th> | |
</tr> | |
</thead> | |
<tbody ref="tbody"></tbody> | |
<tfoot> | |
<tr> | |
<th colspan.bind="columns.length"> | |
<select> | |
<option value="10">10</option> | |
<option value="50">50</option> | |
<option value="100">100</option> | |
</select> | |
</th> | |
</tr> | |
</tfoot> | |
</table> | |
columns.length: ${columns.length} | |
</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 {children} from 'aurelia-framework'; | |
export class Grid { | |
@children('column') columns | |
} | |
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://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