Last active
December 24, 2016 03:12
-
-
Save lebolo/b777696e1fb8bf52cbb62d8c00486045 to your computer and use it in GitHub Desktop.
Aurelia Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h1>${message}</h1> | |
<div class="page-host"> | |
app | |
<router-view name="left"></router-view> | |
</div> | |
<div class="page-host"> | |
app | |
<router-view name="right"></router-view> | |
</div> | |
<div class="page-host"> | |
app | |
<router-view></router-view> | |
</div> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class App { | |
message = 'Hello World!'; | |
configureRouter(config, router) { | |
this.router = router; | |
config.title = 'Aurelia'; | |
config.map([ | |
{ | |
route: ['', 'app'], | |
name: 'app', | |
title: 'app', | |
viewPorts: { | |
default: { moduleId: "home" }, | |
left: { moduleId: "left" }, | |
right: { moduleId: "right" } | |
}, | |
nav: true | |
} | |
]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h1>${message}</h1> | |
<span>These routes don't work because home.js does not configure any routes</span> | |
<div class="page-host"> | |
home | |
<router-view name="left"></router-view> | |
</div> | |
<div class="page-host"> | |
home | |
<router-view name="right"></router-view> | |
</div> | |
<div class="page-host"> | |
home | |
<router-view></router-view> | |
</div> | |
<span>These routes don't work because home.js does not configure any routes</span> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Home { | |
constructor() { | |
this.message = "hello"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h2>${message}</h2> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Left { | |
message = 'Left'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h2>${message}</h2> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Right { | |
message = 'Right'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment