Skip to content

Instantly share code, notes, and snippets.

@fabioluz
Forked from jdanyow/app.html
Last active July 25, 2016 21:26
Show Gist options
  • Save fabioluz/fae6b9c9c2e3a608a60522392329bae1 to your computer and use it in GitHub Desktop.
Save fabioluz/fae6b9c9c2e3a608a60522392329bae1 to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<compose view="./my-element.html" view-model="./my-element"></compose>
<br>
<br>
<!--<require from="./my-element"></require>-->
<!--<my-element></my-element>-->
</template>
export class App {
someMessage = 'My message here';
}
<!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>
--- Message: <br> ${someMessage}
</template>
export class MyElement {
bind(bindingContext, parentOverrideContext) {
//to access parent's properties
// this.parent = parentOverrideContext.parentOverrideContext
// .bindingContext;
// alert(this.parent.someMessage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment