Skip to content

Instantly share code, notes, and snippets.

@taosd
Forked from jdanyow/app.html
Last active June 4, 2020 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save taosd/449b09d5e3ed8ba940242d396b1d94da to your computer and use it in GitHub Desktop.
Save taosd/449b09d5e3ed8ba940242d396b1d94da to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<require from="./card"></require>
<h1>I'm the app - I see the message as "${data.message}"</h1>
<card data.bind="data">
</card>
</template>
export class App {
data = { message: 'Hello' };
}
<template>
<require from="./partial"></require>
<h2>I'm a card - I see the message as "${data.message}"</h2>
<partial data.bind="data"></partial>
</template>
import { bindable } from 'aurelia-framework';
export class Card {
@bindable data = { message: ''};
}
<!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>
<template>I'm a partial - Message <input type="text" value.bind="data.message" /></template>
import { bindable } from 'aurelia-framework';
export class Partial {
@bindable data = { message: ''};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment