Skip to content

Instantly share code, notes, and snippets.

@Vheissu
Last active September 17, 2018 04:27
Show Gist options
  • Save Vheissu/c7f3898bcf76191be9033962cff098e7 to your computer and use it in GitHub Desktop.
Save Vheissu/c7f3898bcf76191be9033962cff098e7 to your computer and use it in GitHub Desktop.
Kent C. Dodds example
<template>
<require from="./counter"></require>
<counter></counter>
</template>
export class App {
}
import { inlineView } from 'aurelia-framework';
@inlineView(`<template><button click.delegate="increment()">\${count}\</button></template>`)
export class CounterCustomElement {
count = 0;
increment() {
this.count += 1;
}
}
<!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