Skip to content

Instantly share code, notes, and snippets.

@AshleyGrant
Forked from jdanyow/app.html
Created August 29, 2016 20:59
Show Gist options
  • Save AshleyGrant/f83665056ab59a396439070cc4a8c899 to your computer and use it in GitHub Desktop.
Save AshleyGrant/f83665056ab59a396439070cc4a8c899 to your computer and use it in GitHub Desktop.
<template>
<input type="text" value.bind="foo.bar" />
<button click.delegate="fireSignal()">Fire signal</button>
<div>
Without Signal:
<div><pre>${foo | toJson}</pre></div>
</div>
<div>
With Signal:
<div><pre>${foo | toJson & signal:'my-signal'}</pre></div>
</div>
</template>
import {BindingSignaler} from 'aurelia-templating-resources';
import {inject} from 'aurelia-framework';
@inject(BindingSignaler)
export class App {
constructor(signaler) {
this.signaler = signaler;
}
fireSignal() {
this.signaler.signal('my-signal')
}
foo = {
bar: 'Ashley'
}
}
export class ToJsonValueConverter {
toView(value) {
return JSON.stringify(value);
}
}
<!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