Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
fix(all): update to latest router usage
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Apr 21, 2015
1 parent e785745 commit 1bb373f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/animation-main.js
Expand Up @@ -4,5 +4,5 @@ export function configure(aurelia) {
.developmentLogging()
.plugin('aurelia-animator-css');

aurelia.start().then(a => a.setRoot('app', document.body));
aurelia.start().then(a => a.setRoot());
}
20 changes: 8 additions & 12 deletions src/app.js
@@ -1,19 +1,15 @@
import {inject} from 'aurelia-framework';
import {Router} from 'aurelia-router';
import 'bootstrap';
import 'bootstrap/css/bootstrap.css!';

@inject(Router)
export class App {
constructor(router) {
configureRouter(config, router){
config.title = 'Aurelia';
config.map([
{ route: ['','welcome'], moduleId: './welcome', nav: true, title:'Welcome' },
{ route: 'flickr', moduleId: './flickr', nav: true },
{ route: 'child-router', moduleId: './child-router', nav: true, title:'Child Router' }
]);

this.router = router;
this.router.configure(config => {
config.title = 'Aurelia';
config.map([
{ route: ['','welcome'], moduleId: './welcome', nav: true, title:'Welcome' },
{ route: 'flickr', moduleId: './flickr', nav: true },
{ route: 'child-router', moduleId: './child-router', nav: true, title:'Child Router' }
]);
});
}
}
19 changes: 7 additions & 12 deletions src/child-router.js
@@ -1,18 +1,13 @@
import {inject} from 'aurelia-framework';
import {Router} from 'aurelia-router';

@inject(Router)
export class ChildRouter{
heading = 'Child Router';

constructor(router){
configureRouter(config, router){
config.map([
{ route: ['','welcome'], moduleId: './welcome', nav: true, title:'Welcome' },
{ route: 'flickr', moduleId: './flickr', nav: true },
{ route: 'child-router', moduleId: './child-router', nav: true, title:'Child Router' }
]);

this.router = router;
router.configure(config => {
config.map([
{ route: ['','welcome'], moduleId: './welcome', nav: true, title:'Welcome' },
{ route: 'flickr', moduleId: './flickr', nav: true },
{ route: 'child-router', moduleId: './child-router', nav: true, title:'Child Router' }
]);
});
}
}

0 comments on commit 1bb373f

Please sign in to comment.