Skip to content

Instantly share code, notes, and snippets.

@opcodewriter
Last active March 15, 2016 08:54
Show Gist options
  • Save opcodewriter/5bfe31c3e031da2d2af9 to your computer and use it in GitHub Desktop.
Save opcodewriter/5bfe31c3e031da2d2af9 to your computer and use it in GitHub Desktop.
Aurelia If Bind test on <content>
<template>
<require from="./click-to-edit"></require>
<click-to-edit>
This text node is in DOM only until after click
</click-to-edit>
</template>
export class App {
}
<template>
<button click.trigger='clicked()'>Click Me</button>
<!-- you can't use if.bind on <content> https://github.com/aurelia/templating/issues/271#issuecomment-186368960 -->
<content if.bind='isVisible'></content>
</template>
import {bindable} from 'aurelia-framework';
export class ClickToEdit
{
@bindable isVisible = false;
clicked()
{
this.isVisible = 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://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/jspm_packages/system.js"></script>
<script src="https://cdn.rawgit.com/jdanyow/aurelia-bundle/v1.0.3/config.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment