Skip to content

Instantly share code, notes, and snippets.

@3cp
Created November 5, 2020 00:44
Show Gist options
  • Save 3cp/645eee1920edd24cfdef9407a82ff511 to your computer and use it in GitHub Desktop.
Save 3cp/645eee1920edd24cfdef9407a82ff511 to your computer and use it in GitHub Desktop.
au1 demo.call
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber gist uses dumber bundler, the default bundle file
is /dist/entry-bundle.js.
The starting module is pointed to aurelia-bootstrapper
(data-main attribute on script) for Aurelia,
The aurelia bootstrapper then loads up user module "main"
(aurelia-app attribute on <body>) which is your src/main.js.
-->
<body aurelia-app="main">
<script src="/dist/entry-bundle.js" data-main="aurelia-bootstrapper"></script>
</body>
</html>
{
"dependencies": {
"aurelia-bootstrapper": "^2.3.3"
}
}
<template>
<require from="./play"></require>
<play on-press.call="count = count + value"></play>
<p>Count: ${count}</p>
</template>
export class App {
count = 0;
}
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging('info');
aurelia.start().then(() => aurelia.setRoot());
}
<template>
<button click.trigger="addOne()">Add One</button>
<button click.trigger="addTwo()">Add Two</button>
</template>
import {bindable} from 'aurelia-framework';
export class Play {
@bindable onPress;
addOne() {
this.onPress({value: 1});
}
addTwo() {
this.onPress({value: 2});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment