Skip to content

Instantly share code, notes, and snippets.

@MaxRozyskul
Forked from davismj/app.html
Created March 13, 2018 20:55
Show Gist options
  • Save MaxRozyskul/387cfd7c417ffd84c267c03445fec985 to your computer and use it in GitHub Desktop.
Save MaxRozyskul/387cfd7c417ffd84c267c03445fec985 to your computer and use it in GitHub Desktop.
Aurelia Menu Sample
<template>
<div>
<button repeat.for="route of router.navigation" click.delegate="router.navigateToRoute(route.config.name)">${route.title} ${route.isActive}</button>
</div>
<h1>Aurelia Menu with Child Routes example</h1>
<div>
<router-view></router-view>
</div>
</template>
export class App {
configureRouter(config, router) {
config.title = 'Child Route Menu Example';
config.map( [
{ route: '', name: 'home', moduleId: 'home', nav: true, title: 'Home' },
{ route: 'child', name: 'child', moduleId: 'app', nav: true, title: 'Child' }
] );
this.router = router;
}
}
<template></template>
export class HomeViewModel {}
<!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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment