Skip to content

Instantly share code, notes, and snippets.

@jdanyow
Forked from len-ro/app.html
Last active September 29, 2016 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdanyow/2b535b943d372602000a01298594bf1b to your computer and use it in GitHub Desktop.
Save jdanyow/2b535b943d372602000a01298594bf1b to your computer and use it in GitHub Desktop.
<template>
<button type="button" click.delegate="onChange($event, 'm1')">M1</button>
<button type="button" click.delegate="onChange($event, 'm2')">M2</button>
<button type="button" click.delegate="logModel($event)">Log</button>
<compose view.bind="myView" model.bind="$this"></compose>
</template>
import {inject} from 'aurelia-framework';
export class BasicUse {
onChange(event, viewName){
//delete this.myModel;
this.myView = viewName + ".html";
}
logModel(event){
console.dir(this.myModel);
}
}
<template>
My D
</template>
export class D{}
<!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>
<require from="d"></require>
M1
<d view-model.ref="myModel"></d>
</template>
<template>
<require from="d"></require>
M2
<d view-model.ref="myModel"></d>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment