Skip to content

Instantly share code, notes, and snippets.

@bigopon
Forked from jdanyow/app.html
Last active December 10, 2016 09:25
Show Gist options
  • Save bigopon/d6017efcd3ad31d02a05bdcf213cf17b to your computer and use it in GitHub Desktop.
Save bigopon/d6017efcd3ad31d02a05bdcf213cf17b to your computer and use it in GitHub Desktop.
Aurelia Gist nested compose bubble
<template>
<h1>${message}</h1>
<compose view-model.bind='level1ViewModel'></compose>
</template>
export class App {
message = 'Hello World!';
level1ViewModel = './level1'
}
<!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>
<template>
<span click.trigger='isEditing = 1'>${name}</span>
<input if.bind='isEditing' value.bind='name'/>
<compose view-model.bind='level2ViewModel'></compose>
</template>
export class Level1 {
level2ViewModel = './level2'
}
<template>
<span click.trigger='isEditing = 1'>${name}</span>
<input if.bind='isEditing' value.bind='name'/>
</template>
export class Level2 {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment