Skip to content

Instantly share code, notes, and snippets.

@lebolo
Last active December 24, 2016 02:57
Show Gist options
  • Save lebolo/13fa72a2b4d18c97fd971145d32eeef7 to your computer and use it in GitHub Desktop.
Save lebolo/13fa72a2b4d18c97fd971145d32eeef7 to your computer and use it in GitHub Desktop.
Aurelia Gist
<template>
<h1>${message}</h1>
<div class="page-host">
<router-view name="left"></router-view>
</div>
<div class="page-host">
<router-view name="right"></router-view>
</div>
</template>
export class App {
message = 'Hello World!';
configureRouter(config, router) {
this.router = router;
config.title = 'Aurelia';
config.map([
{
route: ['', 'home'],
name: 'home',
title: 'home',
viewPorts: {
left: { moduleId: "left" },
right: { moduleId: "right" }
},
nav: true
}
]);
}
}
<!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>
<h2>${message}</h2>
</template>
export class Left {
message = 'Left';
}
<template>
<h2>${message}</h2>
</template>
export class Right {
message = 'Right';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment