Created
March 23, 2017 17:19
-
-
Save fabioluz/0bf1e32cdccc37ceebc57c2d74ba2ca0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
<require from="./sidebar"></require> | |
<sidebar view-model.ref="sidebar"></sidebar> | |
<br><br> | |
<router-view></router-view> | |
</template> |
This file contains hidden or 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
import { Sidebar } from './sidebar'; | |
import { Container, inject } from 'aurelia-framework'; | |
@inject(Container) | |
export class App { | |
message = 'Hello World!'; | |
constructor(container) { | |
this.container = container; | |
} | |
bind() { | |
this.container.registerInstance(Sidebar, this.sidebar); | |
} | |
configureRouter(config, router) { | |
config.map([{ route: '', name: 'route-1', moduleId: './route-1' }]); | |
this.router = router; | |
} | |
} |
This file contains hidden or 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 hidden or 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> | |
Route 1 | |
</template> |
This file contains hidden or 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
import { Sidebar } from './sidebar'; | |
import { inject } from 'aurelia-framework'; | |
@inject(Sidebar) | |
export class Route1 { | |
constructor(sidebar) { | |
this.sidebar = sidebar; | |
this.sidebar.admin = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment