Skip to content

Instantly share code, notes, and snippets.

@bigopon
Forked from weoreference/index.html
Created December 10, 2016 09:18
Show Gist options
  • Save bigopon/245f1bfdf930ed57e4d5e03034a0d752 to your computer and use it in GitHub Desktop.
Save bigopon/245f1bfdf930ed57e4d5e03034a0d752 to your computer and use it in GitHub Desktop.
Aurelia | Compose nested issue
<template>
<compose view-model.bind='level1ViewModel'></compose>
</template>
export class App {
level1ViewModel = './level1a'
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
</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>
</html>
<template>
<span click.trigger='isEditingName = 1'>${name}</span>
<input if.bind='isEditingName' value.bind='name'/>
<br/>
<hr/>
<compose view-model.bind='level2ViewModel'></compose>
</template>
import {useView} from 'aurelia-framework'
@useView('./level1.html')
export class Level1a {
level2ViewModel = './level2'
}
import {useView} from 'aurelia-framework'
import { Level1a } from './level1a';
@useView('./level1.html')
export class Level1b extends Level1a {
}
<template>
<span click.trigger='isEditingName = 1'>${name}</span>
<input if.bind='isEditingName' value.bind='name'/>
</template>
import {useView} from 'aurelia-framework'
@useView('./level2.html')
export class Level2a {
}
import {useView} from 'aurelia-framework'
import { Level2a } from './level2a'
@useView('./level2.html')
export class Level2b extends Level2a {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment