Skip to content

Instantly share code, notes, and snippets.

@fabioluz
Last active August 9, 2016 15:29
Show Gist options
  • Save fabioluz/88500143701dab0b0697b17a211af3a7 to your computer and use it in GitHub Desktop.
Save fabioluz/88500143701dab0b0697b17a211af3a7 to your computer and use it in GitHub Desktop.
<template>
${message}
<hr>
Example 1
<div click.delegate="update()">
<div class="checkbox">
<label>
<input checked.bind="isChecked" type="checkbox"> Visibility
</label>
</div>
</div>
<br><br>
Example 2
<div click.delegate="update2()">
<div class="checkbox">
<label>
<input checked.bind="isChecked2" type="checkbox"> Visibility
</label>
</div>
</div>
</template>
import {BindingSignaler} from 'aurelia-templating-resources';
import { TaskQueue } from 'aurelia-task-queue';
export class App {
message = 'Hello World!';
static inject() { return [BindingSignaler, TaskQueue]; }
constructor(signaler, taskQueue) {
this.signaler = signaler;
this.taskQueue = taskQueue;
}
isChecked = false;
isChecked2 = false;
update(){
this.taskQueue.queueTask(() => {
alert(this.isChecked);
});
return true;
}
update2(){
alert(this.isChecked2);
return true;
}
}
<!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