Skip to content

Instantly share code, notes, and snippets.

@gimerstedt
Created August 13, 2020 14:54
Show Gist options
  • Select an option

  • Save gimerstedt/95502d6c14523643233f4b9e5042febc to your computer and use it in GitHub Desktop.

Select an option

Save gimerstedt/95502d6c14523643233f4b9e5042febc to your computer and use it in GitHub Desktop.
router test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber Gist uses dumber bundler, the default bundle file
is /dist/entry-bundle.js.
The starting module is pointed to "main" (data-main attribute on script)
which is your src/main.ts.
-->
<body>
<my-app></my-app>
<script src="/dist/entry-bundle.js" data-main="main"></script>
</body>
</html>
{
"dependencies": {
"aurelia": "dev"
}
}
import Aurelia, { RouterConfiguration } from 'aurelia';
import { MyApp } from './my-app';
Aurelia.register(RouterConfiguration).app(MyApp).start();
<import from="./my-view"></import>
<h1>${message}</h1>
<au-viewport default="my-view"></au-viewport>
export class MyApp {
public message: string = 'Hello Aurelia 2!';
}
Hi, serious info here.
export class MyView {
enter() {
console.log('enter my-view')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment