Created
June 1, 2016 16:47
-
-
Save niieani/1a580b9fe19d4ce90ebd478ab41d0692 to your computer and use it in GitHub Desktop.
Aurelia Nested Router Problem
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> | |
<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
export class App { | |
configureRouter(config, router) { | |
config.map([ | |
{ route: '', name: 'one', moduleId: './one', nav: true, title: 'One' } | |
]); | |
this.router = router; | |
} | |
message = "hello from app"; | |
} |
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> | |
<p>Test (first-level router): ${router} / ${message} / ${message2}</p> | |
<router-view></router-view> | |
<!-- bindings on router-view also don't work --> | |
<!--<router-view message.bind="message"></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
export class One { | |
configureRouter(config, router) { | |
config.map([ | |
{ route: '', name: 'two', moduleId: './two', nav: true, title: 'Two' } | |
]); | |
this.router = router; | |
} | |
message2 = "hello from one"; | |
} |
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> | |
<p>Test (nested router): ${router} / ${message} / ${message2}</p> | |
</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 {bindable} from 'aurelia-framework'; | |
export class Two { | |
// doesn't even work when we try to bind these values | |
// @bindable message; | |
// @bindable message2; | |
// @bindable router; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment