Skip to content

Instantly share code, notes, and snippets.

@fabioluz
Last active February 18, 2017 20:54
Show Gist options
  • Save fabioluz/11b928907440e90ea6564ec18d4e0f76 to your computer and use it in GitHub Desktop.
Save fabioluz/11b928907440e90ea6564ec18d4e0f76 to your computer and use it in GitHub Desktop.
Aurelia RJS Gist
<template>
${message}
<br><br>
<a route-href="route: step">Go To Step</a>
<br><br>
<router-view></router-view>
</template>
export class App {
message = 'Hello World!';
configureRouter(config, router) {
config.map([
{ route: '', name: 'default', moduleId: './default', nav: true },
{ route: 'step', name: 'step', moduleId: './step', nav: true }
]);
this.router = router;
}
}
import { inlineView } from 'aurelia-framework';
@inlineView('<template></template>')
export class Default {
}
<!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>
import { inlineView } from 'aurelia-framework';
@inlineView(`<template></template>`)
export class StepDefault {
}
import { inlineView } from 'aurelia-framework';
@inlineView(`
<template>
Step
<br><br>
<a route-href="route: step2">Go To Step 2</a>
<router-view></router-view>
</template>`)
export class Step {
configureRouter(config, router) {
config.map([
{ route: '', name: 'step-default', moduleId: './step-default', nav: true },
{ route: 'step2', name: 'step2', moduleId: './step2', nav: true }
]);
this.router = router;
}
}
import { inlineView } from 'aurelia-framework';
@inlineView(`
<template>
<br><br>
Step 2
</template>`)
export class Step2 {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment