Skip to content

Instantly share code, notes, and snippets.

@opcodewriter
Forked from jdanyow/app.html
Last active March 16, 2016 14:16
Show Gist options
  • Save opcodewriter/0ec28f7c36833e2508c1 to your computer and use it in GitHub Desktop.
Save opcodewriter/0ec28f7c36833e2508c1 to your computer and use it in GitHub Desktop.
Aurelia If Bind test on template part
<template>
<require from="./click-to-edit"></require>
<click-to-edit>
<template replace-part='item-template'>
This text node is in DOM only after click
</template>
</click-to-edit>
</template>
export class App {
}
<template>
<button click.trigger='clicked()'>Click Me</button>
<template replaceable part="item-template" if.bind='isVisible'>
</template>
</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